From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Andy Gross <andy.gross@linaro.org>, David Brown <david.brown@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
Arun Kumar Neelakantam <aneela@codeaurora.org>,
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 [thread overview]
Message-ID: <20170814214922.18061-2-bjorn.andersson@linaro.org> (raw)
In-Reply-To: <20170814214922.18061-1-bjorn.andersson@linaro.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 <bjorn.andersson@linaro.org>
---
Chances since v1:
- None
drivers/soc/qcom/smem.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
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);
--
2.12.0
next prev parent reply other threads:[~2017-08-14 21:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-14 21:49 [PATCH v2 0/2] Qualcomm SMEM cached item support Bjorn Andersson
2017-08-14 21:49 ` Bjorn Andersson [this message]
2017-09-15 19:19 ` [PATCH v2 1/2] soc: qcom: smem: Rename "uncached" accessors Stephen Boyd
2017-09-15 22:36 ` Bjorn Andersson
2017-09-19 5:38 ` Stephen Boyd
2017-08-14 21:49 ` [PATCH v2 2/2] soc: qcom: smem: Support getting cached entries Bjorn Andersson
2017-09-15 19:27 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170814214922.18061-2-bjorn.andersson@linaro.org \
--to=bjorn.andersson@linaro.org \
--cc=andy.gross@linaro.org \
--cc=aneela@codeaurora.org \
--cc=david.brown@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®