From patchwork Thu Aug 10 19:37:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 109847 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2825279qge; Thu, 10 Aug 2017 12:38:38 -0700 (PDT) X-Received: by 10.98.18.131 with SMTP id 3mr13389891pfs.19.1502393918648; Thu, 10 Aug 2017 12:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502393918; cv=none; d=google.com; s=arc-20160816; b=bXgA4fd9bqDpSD94NK1IlNddOe+ucwVilOvmSFj+BMZhhwiBS0VOgZ5PYkIBx6hWx5 vikxlg+Bcb1BUnf4WFDOGxFXpf7YVZ47WClKDyxrvaqy9susyXM9Ae4q4AVwbniNKspM 1EeOPUaVik60gFbPfWBQjryw0nijQmSHirU1TVUlb6VmCOdj3UNZu95ZatT5GD8cQRMR RkmU8W8R/zr4qhIzVo2hi9/V6K1aL9SbsSn2CNfYw3NUoQ+ktu2tYKHB/NQUs53mcuP0 b6VIA4new++Yjf9NyFVZCD2vW2BW1akzJ7Qoz1V07v2jtj3dd6uVGmpNV1stX2F25M2Q spug== 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=rfnO1RUQY7pdRb/J/PE9qvKf53ojN/hmxSAj3su3I1c=; b=PGP1Y3kkh/hKAOV7oK/GTZY05j3s7n6L+k7DhQDb853SBQ8vI2Kf450IRDxhQw1Kzc vEGJ6xW5Se9FHTHD/gF6jVLJSxpt1l3uZEW54RATLLhP3ReOUuVYLhdaTeDWsqjBIVXM GeF6ucqJxGLB8Zg/jqY+d3TtcDs5m9aplTDpqhLhNOUUBPHRi1He+QUXpUeri2GV/m6u eb2Sbk29Z6C08v8QM/5VF8PFfpQm1JlWZ5SKPN3duvWtdeAOfEx+9tb4svAcfMwa+XFf GVkKrfP1vzx2dCV8210HlOncagdwRREA5abC1M1JVS6hkLpdRSqpcrGQOYWC8xljZxbn bjCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=df2BrDlZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 b5si4842996ple.560.2017.08.10.12.38.38; Thu, 10 Aug 2017 12:38:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=df2BrDlZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbdHJTid (ORCPT + 25 others); Thu, 10 Aug 2017 15:38:33 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35580 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbdHJTiD (ORCPT ); Thu, 10 Aug 2017 15:38:03 -0400 Received: by mail-pf0-f182.google.com with SMTP id t86so6924115pfe.2 for ; Thu, 10 Aug 2017 12:38:03 -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=rfnO1RUQY7pdRb/J/PE9qvKf53ojN/hmxSAj3su3I1c=; b=df2BrDlZf/2UYNGdQADUsY6NQcM+PYjPwchF2nxVRx53i/nrAtZIQqK9glDcsn7TeP Lx6Vl9Adx4AlxdmgoG+XqJmmvQFVr5hYjnLph1KyZKZhmZgGcIHmGkUXty/0Ln8hv31B BOvn0pY3xiRz3xOW8VPurPSrYUG0gtLBIKtSk= 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=rfnO1RUQY7pdRb/J/PE9qvKf53ojN/hmxSAj3su3I1c=; b=AApgydykrPFvGdiB2/r1CvHZ1WV9nw1Oy/TzRfwmeLtwxrUqEl3xiXVxSSm6lRMSV+ Gd89mtx0oMqCZkh3qJZWMzH9AjhDTQSkWut2EM484wjXRmOkDc6U+w/grOoaYfZ25+xt OugAUs/A5Ip9UMjMIDbdtrauiRSo3Ns4SKMR29sG0UOEuoLM75i35y1Tam+/+cTK761p 7lExUyrGt9W4d0Bf4Q8yREZjyyE6A3eqDsSW0V9MWSnpRzkLfBozYJ1/OmFokW2avtrR Q5igEhOlizY2ot2QDGblosOAjWnJN1oyfKZn6dSihErCZa7VpFKp8TgUkue6UjzcjQjV kJJQ== X-Gm-Message-State: AHYfb5gpGN3xMBuQr2xlBi2xXqGBvmjeHddr9r3MLUAB4QnEyUGYfPbd 28giHfs6oa6Km7xe X-Received: by 10.84.151.68 with SMTP id i62mr14891244pli.225.1502393883074; Thu, 10 Aug 2017 12:38:03 -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 d71sm13523970pfg.169.2017.08.10.12.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 12:38:02 -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 1/2] soc: qcom: smem: Rename "uncached" accessors Date: Thu, 10 Aug 2017 12:37:56 -0700 Message-Id: <20170810193757.9136-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170810193757.9136-1-bjorn.andersson@linaro.org> References: <20170810193757.9136-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/soc/qcom/smem.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.12.0 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);