All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Feng <puck.chen@hisilicon.com>
To: weiyj_lk@163.com, Xinliang Liu <z.liuxinliang@hisilicon.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	David Airlie <airlied@linux.ie>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] drm/hisilicon: Fix return value check in ade_dts_parse()
Date: Sat, 18 Jun 2016 09:29:09 +0800	[thread overview]
Message-ID: <5764A3E5.50207@hisilicon.com> (raw)
In-Reply-To: <1466188173-19776-1-git-send-email-weiyj_lk@163.com>

Thanks!

On 2016/6/18 2:29, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function devm_clk_get() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check
> should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Chen Feng <puck.chen@hisilicon.com>
> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index ed76baad..16834f4 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -965,21 +965,21 @@ static int ade_dts_parse(struct platform_device *pdev, struct ade_hw_ctx *ctx)
>  	}
>  
>  	ctx->ade_core_clk = devm_clk_get(dev, "clk_ade_core");
> -	if (!ctx->ade_core_clk) {
> +	if (IS_ERR(ctx->ade_core_clk)) {
>  		DRM_ERROR("failed to parse clk ADE_CORE\n");
> -		return -ENODEV;
> +		return PTR_ERR(ctx->ade_core_clk);
>  	}
>  
>  	ctx->media_noc_clk = devm_clk_get(dev, "clk_codec_jpeg");
> -	if (!ctx->media_noc_clk) {
> +	if (IS_ERR(ctx->media_noc_clk)) {
>  		DRM_ERROR("failed to parse clk CODEC_JPEG\n");
> -	    return -ENODEV;
> +		return PTR_ERR(ctx->media_noc_clk);
>  	}
>  
>  	ctx->ade_pix_clk = devm_clk_get(dev, "clk_ade_pix");
> -	if (!ctx->ade_pix_clk) {
> +	if (IS_ERR(ctx->ade_pix_clk)) {
>  		DRM_ERROR("failed to parse clk ADE_PIX\n");
> -	    return -ENODEV;
> +		return PTR_ERR(ctx->ade_pix_clk);
>  	}
>  
>  	return 0;
> 
> 
> 
> 
> 
> 
> .
> 

WARNING: multiple messages have this Message-ID (diff)
From: Chen Feng <puck.chen@hisilicon.com>
To: <weiyj_lk@163.com>, Xinliang Liu <z.liuxinliang@hisilicon.com>,
	"Xinwei Kong" <kong.kongxinwei@hisilicon.com>,
	David Airlie <airlied@linux.ie>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] drm/hisilicon: Fix return value check in ade_dts_parse()
Date: Sat, 18 Jun 2016 09:29:09 +0800	[thread overview]
Message-ID: <5764A3E5.50207@hisilicon.com> (raw)
In-Reply-To: <1466188173-19776-1-git-send-email-weiyj_lk@163.com>

Thanks!

On 2016/6/18 2:29, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function devm_clk_get() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check
> should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Chen Feng <puck.chen@hisilicon.com>
> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index ed76baad..16834f4 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -965,21 +965,21 @@ static int ade_dts_parse(struct platform_device *pdev, struct ade_hw_ctx *ctx)
>  	}
>  
>  	ctx->ade_core_clk = devm_clk_get(dev, "clk_ade_core");
> -	if (!ctx->ade_core_clk) {
> +	if (IS_ERR(ctx->ade_core_clk)) {
>  		DRM_ERROR("failed to parse clk ADE_CORE\n");
> -		return -ENODEV;
> +		return PTR_ERR(ctx->ade_core_clk);
>  	}
>  
>  	ctx->media_noc_clk = devm_clk_get(dev, "clk_codec_jpeg");
> -	if (!ctx->media_noc_clk) {
> +	if (IS_ERR(ctx->media_noc_clk)) {
>  		DRM_ERROR("failed to parse clk CODEC_JPEG\n");
> -	    return -ENODEV;
> +		return PTR_ERR(ctx->media_noc_clk);
>  	}
>  
>  	ctx->ade_pix_clk = devm_clk_get(dev, "clk_ade_pix");
> -	if (!ctx->ade_pix_clk) {
> +	if (IS_ERR(ctx->ade_pix_clk)) {
>  		DRM_ERROR("failed to parse clk ADE_PIX\n");
> -	    return -ENODEV;
> +		return PTR_ERR(ctx->ade_pix_clk);
>  	}
>  
>  	return 0;
> 
> 
> 
> 
> 
> 
> .
> 

  reply	other threads:[~2016-06-18  1:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 18:29 [PATCH -next] drm/hisilicon: Fix return value check in ade_dts_parse() weiyj_lk
2016-06-18  1:29 ` Chen Feng [this message]
2016-06-18  1:29   ` Chen Feng
2016-06-20  1:56 ` Xinliang Liu
2016-06-20  1:56   ` Xinliang Liu
  -- strict thread matches above, loose matches on Subject: below --
2016-07-13 12:43 weiyj_lk
2016-07-18  1:23 ` Xinliang Liu
2016-07-18  1:23   ` Xinliang Liu

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=5764A3E5.50207@hisilicon.com \
    --to=puck.chen@hisilicon.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiyj_lk@163.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    --cc=z.liuxinliang@hisilicon.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.