aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-10-04 23:11:27 -0400
committerAndy Gross <andy.gross@linaro.org>2017-10-11 17:58:11 -0400
commit01f141544413aa5de45d3979b8aafa9aaf6f9b9f (patch)
tree90c8d32634faca042813b535a37ada6d3dc0aa26
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
soc: qcom: smem: Rename "uncached" accessors
In preparation for adding accessors for "cached" entries rename the "uncached" accessors. Also rename "first" cached entry to "last", as the cached list grows backwards. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
-rw-r--r--drivers/soc/qcom/smem.c26
1 files 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 {
245}; 245};
246 246
247static struct smem_private_entry * 247static struct smem_private_entry *
248phdr_to_last_private_entry(struct smem_partition_header *phdr) 248phdr_to_last_uncached_entry(struct smem_partition_header *phdr)
249{ 249{
250 void *p = phdr; 250 void *p = phdr;
251 251
252 return p + le32_to_cpu(phdr->offset_free_uncached); 252 return p + le32_to_cpu(phdr->offset_free_uncached);
253} 253}
254 254
255static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr) 255static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr)
256{ 256{
257 void *p = phdr; 257 void *p = phdr;
258 258
@@ -260,7 +260,7 @@ static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr)
260} 260}
261 261
262static struct smem_private_entry * 262static struct smem_private_entry *
263phdr_to_first_private_entry(struct smem_partition_header *phdr) 263phdr_to_first_uncached_entry(struct smem_partition_header *phdr)
264{ 264{
265 void *p = phdr; 265 void *p = phdr;
266 266
@@ -268,7 +268,7 @@ phdr_to_first_private_entry(struct smem_partition_header *phdr)
268} 268}
269 269
270static struct smem_private_entry * 270static struct smem_private_entry *
271private_entry_next(struct smem_private_entry *e) 271uncached_entry_next(struct smem_private_entry *e)
272{ 272{
273 void *p = e; 273 void *p = e;
274 274
@@ -276,7 +276,7 @@ private_entry_next(struct smem_private_entry *e)
276 le32_to_cpu(e->size); 276 le32_to_cpu(e->size);
277} 277}
278 278
279static void *entry_to_item(struct smem_private_entry *e) 279static void *uncached_entry_to_item(struct smem_private_entry *e)
280{ 280{
281 void *p = e; 281 void *p = e;
282 282
@@ -300,9 +300,9 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem,
300 void *cached; 300 void *cached;
301 301
302 phdr = smem->partitions[host]; 302 phdr = smem->partitions[host];
303 hdr = phdr_to_first_private_entry(phdr); 303 hdr = phdr_to_first_uncached_entry(phdr);
304 end = phdr_to_last_private_entry(phdr); 304 end = phdr_to_last_uncached_entry(phdr);
305 cached = phdr_to_first_cached_entry(phdr); 305 cached = phdr_to_last_cached_entry(phdr);
306 306
307 while (hdr < end) { 307 while (hdr < end) {
308 if (hdr->canary != SMEM_PRIVATE_CANARY) { 308 if (hdr->canary != SMEM_PRIVATE_CANARY) {
@@ -315,7 +315,7 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem,
315 if (le16_to_cpu(hdr->item) == item) 315 if (le16_to_cpu(hdr->item) == item)
316 return -EEXIST; 316 return -EEXIST;
317 317
318 hdr = private_entry_next(hdr); 318 hdr = uncached_entry_next(hdr);
319 } 319 }
320 320
321 /* Check that we don't grow into the cached region */ 321 /* Check that we don't grow into the cached region */
@@ -460,8 +460,8 @@ static void *qcom_smem_get_private(struct qcom_smem *smem,
460 struct smem_private_entry *e, *end; 460 struct smem_private_entry *e, *end;
461 461
462 phdr = smem->partitions[host]; 462 phdr = smem->partitions[host];
463 e = phdr_to_first_private_entry(phdr); 463 e = phdr_to_first_uncached_entry(phdr);
464 end = phdr_to_last_private_entry(phdr); 464 end = phdr_to_last_uncached_entry(phdr);
465 465
466 while (e < end) { 466 while (e < end) {
467 if (e->canary != SMEM_PRIVATE_CANARY) { 467 if (e->canary != SMEM_PRIVATE_CANARY) {
@@ -476,10 +476,10 @@ static void *qcom_smem_get_private(struct qcom_smem *smem,
476 *size = le32_to_cpu(e->size) - 476 *size = le32_to_cpu(e->size) -
477 le16_to_cpu(e->padding_data); 477 le16_to_cpu(e->padding_data);
478 478
479 return entry_to_item(e); 479 return uncached_entry_to_item(e);
480 } 480 }
481 481
482 e = private_entry_next(e); 482 e = uncached_entry_next(e);
483 } 483 }
484 484
485 return ERR_PTR(-ENOENT); 485 return ERR_PTR(-ENOENT);