From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8320473330095066083==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: [PATCH] i2c: fix ptr_ret.cocci warnings Date: Thu, 13 Feb 2020 18:10:41 +0800 Message-ID: <20200213101038.GA13164@9560152b1213> In-Reply-To: <20200210172929.6001-2-wsa+renesas@sang-engineering.com> List-Id: --===============8320473330095066083== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kbuild test robot drivers/i2c/i2c-core-smbus.c:714: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 Fixes: b0497a4dfd24 ("i2c: convert SMBus alert setup function to return an = ERRPTR") CC: Wolfram Sang Signed-off-by: kbuild test robot --- url: https://github.com/0day-ci/linux/commits/Wolfram-Sang/i2c-updates-t= o-SMBus-alert-setup/20200213-051237 base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/f= or-next i2c-core-smbus.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/i2c/i2c-core-smbus.c +++ b/drivers/i2c/i2c-core-smbus.c @@ -711,10 +711,7 @@ int of_i2c_setup_smbus_alert(struct i2c_ return irq; = client =3D i2c_install_smbus_alert(adapter, NULL); - if (IS_ERR(client)) - return PTR_ERR(client); - - return 0; + return PTR_ERR_OR_ZERO(client); } EXPORT_SYMBOL_GPL(of_i2c_setup_smbus_alert); #endif --===============8320473330095066083==--