From patchwork Mon Aug 14 21:49:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 110065 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4887572qge; Mon, 14 Aug 2017 14:49:50 -0700 (PDT) X-Received: by 10.84.195.228 with SMTP id j91mr28806389pld.381.1502747390451; Mon, 14 Aug 2017 14:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502747390; cv=none; d=google.com; s=arc-20160816; b=b7/Bhu4T0WGbadT69CKbmguwTG2KX2Yr22aXUZ4Y/iKujqQRqR51e/ZMEmB6Fh0ATm 7Y6T/EpPUU/tKcxZU4ZSJC+WHmpLYZbUEo8mv6eTyMs9t1o+bihesKtekfw13Nd/EkWu BfzhGWIP5l3GbpqPAzfwVIj4PIG8TyuCgmBWuB8Vac1IzVS3Da0+SBW4pP23FPviDmYc 49ZYjUDsiuAlmFHJhiutFHqCihaOTjwKwbYUJmv+6PMZNC3cd8z0VTjB1ZIrG1BDwoTc 6CqiT8ioL6pItP1QmqRq6pU5VokbHXFH8BD6pY6qRppjQidUMqMyb20SjTcwH1QDggOZ ETLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=QW//g9Rxl07ICO6aQoaC7FQlI5fhVD/aJv5dkRlYfbI=; b=v2Cz3eZPsZFohjuTV35Ie+6OmPO1rNdROJELhxtKdW3fkl46aemf9fee+TDq5lYdVb CWkUYcmNc2y0H5vSn5pKipoGMbYIW5YT/1/codSM01nzTxeA5AAoZT+DoXcLEbbhQwB4 Vqxwfl1Hmvc2nIsJt0RlrwiZ1KhaYCxzlXoH4YEc/y23PpsXjr7abwFl6J3TITny4huT djrxXeUBGKu3i1xaeaUlfV2p9r/KVAxj91lFRDnShQrDfgOTWs/ycLnHQBm8rUfJl57R kc5yV8juTa0lzfSSBtl4YLPo+ndrk4Za/BfMsrpFFu7ZmjBeo5Ar0/eQULLSteAyjn+Q g+3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DCKTtDo6; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a67si4584655pgc.190.2017.08.14.14.49.49; Mon, 14 Aug 2017 14:49:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DCKTtDo6; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752607AbdHNVte (ORCPT + 9 others); Mon, 14 Aug 2017 17:49:34 -0400 Received: from mail-pg0-f44.google.com ([74.125.83.44]:38515 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588AbdHNVta (ORCPT ); Mon, 14 Aug 2017 17:49:30 -0400 Received: by mail-pg0-f44.google.com with SMTP id l64so54951111pge.5 for ; Mon, 14 Aug 2017 14:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ai1E15kwKtdAPxHm8wjw7v8jWKJ4LEJYhm7A+vYgaJU=; b=DCKTtDo6Tt87N44sOe6NO3OByHkQAkCYRAQvx8iauwp+MrfogN9Zeo/m+u3mGnL/gH Utwhs2zW6BdFM+mssa59qAKR1nnUEoT6a5wVYTA6yG5/1Qo3UCjVavlbBaEOGaE59VPZ ygdThnv9Nc9VbcGRhoR/DAnNZ7K/sTxSOKfFU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ai1E15kwKtdAPxHm8wjw7v8jWKJ4LEJYhm7A+vYgaJU=; b=QQ76Dqz1Wz3ydCOAOuNm54Xi/y4fcQVAvZhZIf6v/cfXRKq8x7myjmihOi1pI1vw2g T0qKPc1ZQq69Q29RCaIhgOdDgkagku/K+RzMqj2GGhOWTDZpUQEcul3gRMDc+OMowpfU pPQ87BfnXeIpTYsahQsR4i1u6uR/w0how3Sg5u+6BM/4prxh+BJrAhqA20p7b45OxQgL 7CyGH9Vr3yMkCrPDO+Q3ZNtX2VKy2vMvILUYnX/bkr+zCZYQLq12gAfkr/A6Xu9aJ8Y8 +N/pdspk+Ao1MF21avQ8Te4WMbxkyJH+IM1ZuUEqR+DMpDpL2ot9gNucCVPqHnQnIeuC ycEw== X-Gm-Message-State: AHYfb5gtAf32u4ULDnQmuTHJYL3sVHSaAI0wslgBU3k4nRb5rwCmTkpU 9ZMhqJT6AdidI90u X-Received: by 10.84.215.130 with SMTP id l2mr28889770pli.116.1502747368717; Mon, 14 Aug 2017 14:49:28 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id m2sm13545458pgs.72.2017.08.14.14.49.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 14:49:28 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , David Brown Cc: Stephen Boyd , Arun Kumar Neelakantam , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] soc: qcom: smem: Rename "uncached" accessors Date: Mon, 14 Aug 2017 14:49:21 -0700 Message-Id: <20170814214922.18061-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170814214922.18061-1-bjorn.andersson@linaro.org> References: <20170814214922.18061-1-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In preparation for adding accessors for "cached" entries rename the "uncached" accessors to. Also rename "first" cached entry to "last", as the cached list grows backwards. Signed-off-by: Bjorn Andersson --- Chances since v1: - None drivers/soc/qcom/smem.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Stephen Boyd diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 18ec52f2078a..b451dbc4aa39 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -245,14 +245,14 @@ struct qcom_smem { }; static struct smem_private_entry * -phdr_to_last_private_entry(struct smem_partition_header *phdr) +phdr_to_last_uncached_entry(struct smem_partition_header *phdr) { void *p = phdr; return p + le32_to_cpu(phdr->offset_free_uncached); } -static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr) +static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr) { void *p = phdr; @@ -260,7 +260,7 @@ static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr) } static struct smem_private_entry * -phdr_to_first_private_entry(struct smem_partition_header *phdr) +phdr_to_first_uncached_entry(struct smem_partition_header *phdr) { void *p = phdr; @@ -268,7 +268,7 @@ phdr_to_first_private_entry(struct smem_partition_header *phdr) } static struct smem_private_entry * -private_entry_next(struct smem_private_entry *e) +uncached_entry_next(struct smem_private_entry *e) { void *p = e; @@ -276,7 +276,7 @@ private_entry_next(struct smem_private_entry *e) le32_to_cpu(e->size); } -static void *entry_to_item(struct smem_private_entry *e) +static void *uncached_entry_to_item(struct smem_private_entry *e) { void *p = e; @@ -300,9 +300,9 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, void *cached; phdr = smem->partitions[host]; - hdr = phdr_to_first_private_entry(phdr); - end = phdr_to_last_private_entry(phdr); - cached = phdr_to_first_cached_entry(phdr); + hdr = phdr_to_first_uncached_entry(phdr); + end = phdr_to_last_uncached_entry(phdr); + cached = phdr_to_last_cached_entry(phdr); while (hdr < end) { if (hdr->canary != SMEM_PRIVATE_CANARY) { @@ -315,7 +315,7 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, if (le16_to_cpu(hdr->item) == item) return -EEXIST; - hdr = private_entry_next(hdr); + hdr = uncached_entry_next(hdr); } /* Check that we don't grow into the cached region */ @@ -460,8 +460,8 @@ static void *qcom_smem_get_private(struct qcom_smem *smem, struct smem_private_entry *e, *end; phdr = smem->partitions[host]; - e = phdr_to_first_private_entry(phdr); - end = phdr_to_last_private_entry(phdr); + e = phdr_to_first_uncached_entry(phdr); + end = phdr_to_last_uncached_entry(phdr); while (e < end) { if (e->canary != SMEM_PRIVATE_CANARY) { @@ -476,10 +476,10 @@ static void *qcom_smem_get_private(struct qcom_smem *smem, *size = le32_to_cpu(e->size) - le16_to_cpu(e->padding_data); - return entry_to_item(e); + return uncached_entry_to_item(e); } - e = private_entry_next(e); + e = uncached_entry_next(e); } return ERR_PTR(-ENOENT);