All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Rohit kumar <rohitkr@codeaurora.org>,
	linux-remoteproc@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] remoteproc: qcom: qcom_q6v5_adsp: Fix some return value check
Date: Wed, 10 Oct 2018 06:10:15 +0000	[thread overview]
Message-ID: <20181010061015.GR12063@builder> (raw)
In-Reply-To: <1539143979-82369-1-git-send-email-weiyongjun1@huawei.com>

On Tue 09 Oct 20:59 PDT 2018, Wei Yongjun wrote:

> In case of error, the functions devm_kcalloc() and devm_ioremap()
> returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return
> value check should be replaced with NULL test.
> 
> Also removed -EPROBE_DEFER check since devm_kcalloc never return
> this error.
> 
> Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks Wei, applied to rproc-next

Regards,
Bjorn

> ---
>  drivers/remoteproc/qcom_q6v5_adsp.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
> index 3285a8b..79374d1 100644
> --- a/drivers/remoteproc/qcom_q6v5_adsp.c
> +++ b/drivers/remoteproc/qcom_q6v5_adsp.c
> @@ -295,12 +295,8 @@ static int adsp_init_clock(struct qcom_adsp *adsp)
>  	adsp->num_clks = ARRAY_SIZE(adsp_clk_id);
>  	adsp->clks = devm_kcalloc(adsp->dev, adsp->num_clks,
>  				sizeof(*adsp->clks), GFP_KERNEL);
> -	if (IS_ERR(adsp->clks)) {
> -		ret = PTR_ERR(adsp->clks);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(adsp->dev, "failed to get adsp clock");
> -		return ret;
> -	}
> +	if (!adsp->clks)
> +		return -ENOMEM;
>  
>  	for (i = 0; i < adsp->num_clks; i++)
>  		adsp->clks[i].id = adsp_clk_id[i];
> @@ -337,9 +333,9 @@ static int adsp_init_mmio(struct qcom_adsp *adsp,
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	adsp->qdsp6ss_base = devm_ioremap(&pdev->dev, res->start,
>  			resource_size(res));
> -	if (IS_ERR(adsp->qdsp6ss_base)) {
> +	if (!adsp->qdsp6ss_base) {
>  		dev_err(adsp->dev, "failed to map QDSP6SS registers\n");
> -		return PTR_ERR(adsp->qdsp6ss_base);
> +		return -ENOMEM;
>  	}
>  
>  	syscon = of_parse_phandle(pdev->dev.of_node, "qcom,halt-regs", 0);
> 

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Rohit kumar <rohitkr@codeaurora.org>,
	linux-remoteproc@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] remoteproc: qcom: qcom_q6v5_adsp: Fix some return value check
Date: Tue, 9 Oct 2018 23:10:15 -0700	[thread overview]
Message-ID: <20181010061015.GR12063@builder> (raw)
In-Reply-To: <1539143979-82369-1-git-send-email-weiyongjun1@huawei.com>

On Tue 09 Oct 20:59 PDT 2018, Wei Yongjun wrote:

> In case of error, the functions devm_kcalloc() and devm_ioremap()
> returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return
> value check should be replaced with NULL test.
> 
> Also removed -EPROBE_DEFER check since devm_kcalloc never return
> this error.
> 
> Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks Wei, applied to rproc-next

Regards,
Bjorn

> ---
>  drivers/remoteproc/qcom_q6v5_adsp.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
> index 3285a8b..79374d1 100644
> --- a/drivers/remoteproc/qcom_q6v5_adsp.c
> +++ b/drivers/remoteproc/qcom_q6v5_adsp.c
> @@ -295,12 +295,8 @@ static int adsp_init_clock(struct qcom_adsp *adsp)
>  	adsp->num_clks = ARRAY_SIZE(adsp_clk_id);
>  	adsp->clks = devm_kcalloc(adsp->dev, adsp->num_clks,
>  				sizeof(*adsp->clks), GFP_KERNEL);
> -	if (IS_ERR(adsp->clks)) {
> -		ret = PTR_ERR(adsp->clks);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(adsp->dev, "failed to get adsp clock");
> -		return ret;
> -	}
> +	if (!adsp->clks)
> +		return -ENOMEM;
>  
>  	for (i = 0; i < adsp->num_clks; i++)
>  		adsp->clks[i].id = adsp_clk_id[i];
> @@ -337,9 +333,9 @@ static int adsp_init_mmio(struct qcom_adsp *adsp,
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	adsp->qdsp6ss_base = devm_ioremap(&pdev->dev, res->start,
>  			resource_size(res));
> -	if (IS_ERR(adsp->qdsp6ss_base)) {
> +	if (!adsp->qdsp6ss_base) {
>  		dev_err(adsp->dev, "failed to map QDSP6SS registers\n");
> -		return PTR_ERR(adsp->qdsp6ss_base);
> +		return -ENOMEM;
>  	}
>  
>  	syscon = of_parse_phandle(pdev->dev.of_node, "qcom,halt-regs", 0);
> 

  reply	other threads:[~2018-10-10  6:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10  3:59 [PATCH -next] remoteproc: qcom: qcom_q6v5_adsp: Fix some return value check Wei Yongjun
2018-10-10  6:10 ` Bjorn Andersson [this message]
2018-10-10  6:10   ` 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=20181010061015.GR12063@builder \
    --to=bjorn.andersson@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=rohitkr@codeaurora.org \
    --cc=weiyongjun1@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.