Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Luca Weiss <luca@z3ntu.xyz>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Loic Poulain <loic.poulain@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] soc: qcom: rmtfs: fix error handling reading qcom,vmid
Date: Mon, 6 Mar 2023 11:16:09 +0100	[thread overview]
Message-ID: <44a6fbdf-a2bc-2cb7-08e6-fb75e5fd97eb@linaro.org> (raw)
In-Reply-To: <20230305-rmtfs-vmid-fix-v1-1-6a7206081602@z3ntu.xyz>



On 5.03.2023 11:32, Luca Weiss wrote:
> of_property_count_u32_elems returns a negative integer when an error
> happens , but since the value was assigned to an unsigned integer, the
> check never worked correctly. Also print the correct variable in the
> error print, ret isn't used here.
> 
> Fixes: e656cd0bcf3d ("soc: qcom: rmtfs: Optionally map RMTFS to more VMs")
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  drivers/soc/qcom/rmtfs_mem.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
> index 9d59ad509a5c7..218397ab0c36f 100644
> --- a/drivers/soc/qcom/rmtfs_mem.c
> +++ b/drivers/soc/qcom/rmtfs_mem.c
> @@ -176,7 +176,8 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	struct reserved_mem *rmem;
>  	struct qcom_rmtfs_mem *rmtfs_mem;
>  	u32 client_id;
> -	u32 num_vmids, vmid[NUM_MAX_VMIDS];
> +	u32 vmid[NUM_MAX_VMIDS];
> +	int num_vmids;
>  	int ret, i;
>  
>  	rmem = of_reserved_mem_lookup(node);
> @@ -229,7 +230,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  
>  	num_vmids = of_property_count_u32_elems(node, "qcom,vmid");
>  	if (num_vmids < 0) {
> -		dev_err(&pdev->dev, "failed to count qcom,vmid elements: %d\n", ret);
> +		dev_err(&pdev->dev, "failed to count qcom,vmid elements: %d\n", num_vmids);
>  		goto remove_cdev;
>  	} else if (num_vmids > NUM_MAX_VMIDS) {
>  		dev_warn(&pdev->dev,
> 

  reply	other threads:[~2023-03-06 10:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05 10:32 [PATCH 0/2] Fix qcom,vmid handling in rmtfs_mem Luca Weiss
2023-03-05 10:32 ` [PATCH 1/2] soc: qcom: rmtfs: fix error handling reading qcom,vmid Luca Weiss
2023-03-06 10:16   ` Konrad Dybcio [this message]
2023-03-05 10:32 ` [PATCH 2/2] soc: qcom: rmtfs: handle optional qcom,vmid correctly Luca Weiss
2023-03-06 10:19   ` Konrad Dybcio
2023-03-07  4:20 ` (subset) [PATCH 0/2] Fix qcom,vmid handling in rmtfs_mem Bjorn Andersson

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=44a6fbdf-a2bc-2cb7-08e6-fb75e5fd97eb@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=luca@z3ntu.xyz \
    --cc=phone-devel@vger.kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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