[PATCH] drm/bridge: tc358764: fix ptr_ret.cocci warnings

kbuild test robot lkp at intel.com
Wed Apr 29 03:08:45 UTC 2020


From: kbuild test robot <lkp at intel.com>

drivers/gpu/drm/bridge/tc358764.c:385:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Sam Ravnborg <sam at ravnborg.org>
Signed-off-by: kbuild test robot <lkp at intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Sam-Ravnborg/drm-bridge-support-drm-bridge-connector-helper-panel-updates/20200428-060830
base:   git://anongit.freedesktop.org/drm-intel for-linux-next

 tc358764.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -382,10 +382,7 @@ static int tc358764_parse_dt(struct tc35
 		return ret;
 
 	ctx->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
-	if (IS_ERR(ctx->panel_bridge))
-		return PTR_ERR(ctx->panel_bridge);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(ctx->panel_bridge);
 }
 
 static int tc358764_configure_regulators(struct tc358764 *ctx)


More information about the dri-devel mailing list