[PATCH 3/4] drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi5_core_init

zhengbin zhengbin13 at huawei.com
Mon Nov 18 12:07:32 UTC 2019


Fixes coccicheck warning:

drivers/gpu/drm/omapdrm/dss/hdmi5_core.c:911:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: zhengbin <zhengbin13 at huawei.com>
---
 drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c
index ff4d35c..b577969 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c
@@ -908,8 +908,5 @@ int hdmi5_core_init(struct platform_device *pdev, struct hdmi_core_data *core)

 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
 	core->base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(core->base))
-		return PTR_ERR(core->base);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(core->base);
 }
--
2.7.4



More information about the dri-devel mailing list