[PATCH] video: fbdev: omap2: Use PTR_ERR_OR_ZERO()

Subsystems: framebuffer layer, omap display subsystem and framebuffer support (dss2), the rest

STALE3145d

2 messages, 2 authors, 2018-01-04 · open the first message on its own page

[PATCH] video: fbdev: omap2: Use PTR_ERR_OR_ZERO()

From: Vasyl Gomonovych <hidden>
Date: 2017-11-29 16:23:04

Fix ptr_ret.cocci warnings:
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c:676: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

Signed-off-by: Vasyl Gomonovych <redacted>
---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
index ec78d61bc551..28de56e21c74 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
@@ -673,10 +673,7 @@ static int hdmi_audio_register(struct device *dev)
 		dev, "omap-hdmi-audio", PLATFORM_DEVID_AUTO,
 		&pdata, sizeof(pdata));
 
-	if (IS_ERR(hdmi.audio_pdev))
-		return PTR_ERR(hdmi.audio_pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi.audio_pdev);
 }
 
 /* HDMI HW IP initialisation */
-- 
1.9.1

Re: [PATCH] video: fbdev: omap2: Use PTR_ERR_OR_ZERO()

From: Bartlomiej Zolnierkiewicz <hidden>
Date: 2018-01-04 13:58:25

On Wednesday, November 29, 2017 05:22:48 PM Vasyl Gomonovych wrote:
Fix ptr_ret.cocci warnings:
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c:676: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

Signed-off-by: Vasyl Gomonovych <redacted>
Patch queued for 4.16, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help