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

kbuild test robot lkp at intel.com
Wed Mar 9 00:15:55 UTC 2016


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 at ti.com>
Signed-off-by: Fengguang Wu <fengguang.wu at intel.com>
---

 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 */


More information about the dri-devel mailing list