[PATCH] drm/i2c: tda998x: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drivers/gpu/drm/i2c/tda998x_drv.c:1329: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: Jyri Sarha <jsarha@xxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

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

--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1326,10 +1326,7 @@ static int tda998x_audio_codec_init(stru
 		dev, HDMI_CODEC_DRV_NAME, PLATFORM_DEVID_AUTO,
 		&codec_data, sizeof(codec_data));
 
-	if (IS_ERR(priv->audio_pdev))
-		return PTR_ERR(priv->audio_pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(priv->audio_pdev);
 }
 
 /* I2C driver functions */
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux