drm/verisilicon: use ERR_CAST instead of ERR_PTR(PTR_ERR())
PATCH 1/1 drm/verisilicon: use ERR_CAST instead of ERR_PTR(PTR_ERR())
ERR_CAST says the same thing without the round trip through an error code.
Signed-off-by Aryan Sinha <[email protected]>
--- drivers/gpu/drm/verisilicon/vs_bridge.c | 2 +- drivers/gpu/drm/verisilicon/vs_crtc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/verisilicon/vs_bridge.c +1 -1
@@ -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;
drivers/gpu/drm/verisilicon/vs_crtc.c +1 -1
@@ -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 */
Signature · 1 line
2.46.0
Icenowy Zheng
maintainerQuoted 2 lines · 在 2026-10-01四的 22:00 +0530,Aryan Sinha写道:
ERR_CASTsays 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 <[email protected]> ```
Thanks for this patch!
Icenowy
Quoted 39 lines
Signed-off-by Aryan Sinha <[email protected]>---
drivers/gpu/drm/verisilicon/vs_bridge.c | 2 +-
drivers/gpu/drm/verisilicon/vs_crtc.c | 2 +-2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/verisilicon/vs_bridge.c +0
-0@@ -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))drivers/gpu/drm/verisilicon/vs_bridge.c +1
-1-return ERR_PTR (PTR_ERR (bridge)); +return ERR_CAST (bridge);
bridge->crtc= crtc;
bridge->intf= intf;drivers/gpu/drm/verisilicon/vs_crtc.c +0
-0@@ -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");drivers/gpu/drm/verisilicon/vs_crtc.c +1
-1-return ERR_PTR (PTR_ERR (primary)); +return ERR_CAST (primary);}
/* Create our cursor plane */