Skip to content

Commit

Permalink
soc: qcom: smem: return proper type for cached entry functions
Browse files Browse the repository at this point in the history
What phdr_to_last_uncached_entry() returns is the address of the
start of the free space following all allocated uncached entries.
It really doesn't refer to an actual (initialized) private entry
structure.   Similarly phdr_to_last_cached_entry() returns the
address of the end of free space, preceding the last allocated cache
entry.  Change both functions' return type to be pointer to void
to reflect this.

Meanwhile, phdr_to_first_cached_entry() really *does* point to a
private entry structure, so change its return type to reflect
this fact.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
  • Loading branch information
Alex Elder authored and Andy Gross committed May 25, 2018
1 parent 7070874 commit e221a1d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/soc/qcom/smem.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,16 @@ struct qcom_smem {
struct smem_region regions[0];
};

static struct smem_private_entry *
static void *
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 struct smem_private_entry *
phdr_to_first_cached_entry(struct smem_partition_header *phdr,
size_t cacheline)
{
void *p = phdr;
Expand All @@ -297,7 +298,8 @@ static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr,
return p + le32_to_cpu(phdr->size) - ALIGN(sizeof(*e), cacheline);
}

static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr)
static void *
phdr_to_last_cached_entry(struct smem_partition_header *phdr)
{
void *p = phdr;

Expand Down

0 comments on commit e221a1d

Please sign in to comment.