mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Icenowy Zheng <zhengxingda@iscas.ac.cn>
To: Aryan Sinha <sinha.aryan03@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	 Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/verisilicon: use ERR_CAST instead of ERR_PTR(PTR_ERR())
Date: Fri, 02 Oct 2026 15:22:42 +0800	[thread overview]
Message-ID: <fe6bd298fe7560f3aeb566532d2bf3d60d5a5304.camel@iscas.ac.cn> (raw)
In-Reply-To: <20261001163104.51165-1-sinha.aryan03@gmail.com>

在 2026-10-01四的 22:00 +0530,Aryan Sinha写道:
> ERR_CAST says the same thing without the round trip through an error
> code.

Yes, I didn't know this thing yet when I was creating this driver.

```
Reviewed-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
```

Thanks for this patch!

Icenowy

> 
> Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
> ---
>  drivers/gpu/drm/verisilicon/vs_bridge.c | 2 +-
>  drivers/gpu/drm/verisilicon/vs_crtc.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/verisilicon/vs_bridge.c
> b/drivers/gpu/drm/verisilicon/vs_bridge.c
> index dc7c85b07..32f9984d8 100644
> --- a/drivers/gpu/drm/verisilicon/vs_bridge.c
> +++ b/drivers/gpu/drm/verisilicon/vs_bridge.c
> @@ -322,7 +322,7 @@ struct vs_bridge *vs_bridge_init(struct
> drm_device *drm_dev,
>  	bridge = devm_drm_bridge_alloc(drm_dev->dev, struct
> vs_bridge, base,
>  				       bridge_funcs);
>  	if (IS_ERR(bridge))
> -		return ERR_PTR(PTR_ERR(bridge));
> +		return ERR_CAST(bridge);
>  
>  	bridge->crtc = crtc;
>  	bridge->intf = intf;
> diff --git a/drivers/gpu/drm/verisilicon/vs_crtc.c
> b/drivers/gpu/drm/verisilicon/vs_crtc.c
> index 0b8a35d09..af8e33c96 100644
> --- a/drivers/gpu/drm/verisilicon/vs_crtc.c
> +++ b/drivers/gpu/drm/verisilicon/vs_crtc.c
> @@ -172,7 +172,7 @@ struct vs_crtc *vs_crtc_init(struct drm_device
> *drm_dev, struct vs_dc *dc,
>  	primary = vs_primary_plane_init(drm_dev, dc);
>  	if (IS_ERR(primary)) {
>  		drm_err(drm_dev, "Couldn't create the primary
> plane\n");
> -		return ERR_PTR(PTR_ERR(primary));
> +		return ERR_CAST(primary);
>  	}
>  
>  	/* Create our cursor plane */


      reply	other threads:[~2026-10-02  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 16:30 Aryan Sinha
2026-10-02  7:22 ` Icenowy Zheng [this message]

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=fe6bd298fe7560f3aeb566532d2bf3d60d5a5304.camel@iscas.ac.cn \
    --to=zhengxingda@iscas.ac.cn \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=sinha.aryan03@gmail.com \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®