LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Alex Elder <elder@linaro.org>
Cc: andy.gross@linaro.org, clew@codeaurora.org,
	aneela@codeaurora.org, david.brown@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] soc: qcom: smem: return proper type for cached entry functions
Date: Tue, 24 Apr 2018 21:39:48 -0700	[thread overview]
Message-ID: <20180425043948.GF2052@tuxbook-pro> (raw)
In-Reply-To: <20180410222542.29474-3-elder@linaro.org>

On Tue 10 Apr 15:25 PDT 2018, Alex Elder wrote:

> 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>

Regards,
Bjorn

> ---
>  drivers/soc/qcom/smem.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
> index 7f38c5e11440..3102aa94aec2 100644
> --- a/drivers/soc/qcom/smem.c
> +++ b/drivers/soc/qcom/smem.c
> @@ -280,7 +280,7 @@ 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;
> @@ -288,7 +288,8 @@ phdr_to_last_uncached_entry(struct smem_partition_header *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;
> @@ -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;
>  
> -- 
> 2.14.1
> 
> --
> 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

  reply	other threads:[~2018-04-25  4:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 22:25 [PATCH 0/6] soc: qcom: smem: bug fixes Alex Elder
2018-04-10 22:25 ` [PATCH 1/6] soc: qcom: smem: fix first cache entry calculation Alex Elder
2018-04-25  4:35   ` Bjorn Andersson
2018-04-10 22:25 ` [PATCH 2/6] soc: qcom: smem: return proper type for cached entry functions Alex Elder
2018-04-25  4:39   ` Bjorn Andersson [this message]
2018-04-10 22:25 ` [PATCH 3/6] soc: qcom: smem: byte swap values properly Alex Elder
2018-04-25  4:44   ` Bjorn Andersson
2018-04-10 22:25 ` [PATCH 4/6] soc: qcom: smem: fix off-by-one error in qcom_smem_alloc_private() Alex Elder
2018-04-25  4:48   ` Bjorn Andersson
2018-04-10 22:25 ` [PATCH 5/6] soc: qcom: smem: fix qcom_smem_set_global_partition() Alex Elder
2018-04-25  4:50   ` Bjorn Andersson
2018-04-10 22:25 ` [PATCH 6/6] soc: qcom: smem: check sooner in qcom_smem_set_global_partition() Alex Elder
2018-04-25  4:52   ` Bjorn Andersson
2018-04-20 12:11 ` [PATCH 0/6] soc: qcom: smem: bug fixes Alex Elder
2018-04-25  4:07   ` Andy Gross
2018-04-25 11:37     ` Alex Elder

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=20180425043948.GF2052@tuxbook-pro \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=clew@codeaurora.org \
    --cc=david.brown@linaro.org \
    --cc=elder@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --subject='Re: [PATCH 2/6] soc: qcom: smem: return proper type for cached entry functions' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).