linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO() to simplify code
@ 2020-12-15  2:16 Tian Tao
  2020-12-15  8:50 ` Maxime Ripard
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-12-15  2:16 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, jernej.skrabec
  Cc: dri-devel, linux-arm-kernel, linux-kernel

Fixes coccicheck warning:
drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO
can be used

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
index b66fa27..12a7b7b 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
@@ -278,10 +278,8 @@ static int sun4i_hdmi_init_regmap_fields(struct sun4i_hdmi *hdmi)
 	hdmi->field_ddc_sck_en =
 		devm_regmap_field_alloc(hdmi->dev, hdmi->regmap,
 					hdmi->variant->field_ddc_sck_en);
-	if (IS_ERR(hdmi->field_ddc_sck_en))
-		return PTR_ERR(hdmi->field_ddc_sck_en);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->field_ddc_sck_en);
 }
 
 int sun4i_hdmi_i2c_create(struct device *dev, struct sun4i_hdmi *hdmi)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO() to simplify code
  2020-12-15  2:16 [PATCH] drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO() to simplify code Tian Tao
@ 2020-12-15  8:50 ` Maxime Ripard
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2020-12-15  8:50 UTC (permalink / raw)
  To: Tian Tao
  Cc: wens, airlied, daniel, jernej.skrabec, dri-devel,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hi,

On Tue, Dec 15, 2020 at 10:16:11AM +0800, Tian Tao wrote:
> Fixes coccicheck warning:
> drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO
> can be used
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

That script shouldn't be there anymore, see:
https://lore.kernel.org/cocci/alpine.DEB.2.21.2001071106420.3004@hadrien/#t

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-15  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15  2:16 [PATCH] drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO() to simplify code Tian Tao
2020-12-15  8:50 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).