Skip to contentSkip to conversation

media: exynos4-is: media-dev.c: use PTR_ERR_OR_ZERO

PATCH In review Daniel W. S. Almeida 1 participant 1 message Aug 7, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/20 media: exynos4-is: media-dev.c: use PTR_ERR_OR_ZERO

From: "Daniel W. S. Almeida" <[email protected]>

Fixes the following coccinelle report:

drivers/media/platform/exynos4-is/media-dev.c:1273:1-3:
WARNING: PTR_ERR_OR_ZERO can be used

By using PTR_ERR_OR_ZERO in place of the existing logic.

Found using - Coccinelle (http://coccinelle.lip6.fr)

---
 drivers/media/platform/exynos4-is/media-dev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/platform/exynos4-is/media-dev.c +1 -3
index 16dd660137a8..9346b08931e2 100644
@@ -1270,10 +1270,8 @@ static int fimc_md_get_pinctrl(struct fimc_md *fmd)
 
 	pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl,
 					PINCTRL_STATE_IDLE);
-	if (IS_ERR(pctl->state_idle))
-		return PTR_ERR(pctl->state_idle);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(pctl->state_idle);
 }
 
 static int cam_clk_prepare(struct clk_hw *hw)
Signature · 1 line
2.28.0