From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0918482522621341089==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [PATCH] misc: hisi_hikey_usb: fix ptr_ret.cocci warnings Date: Tue, 15 Sep 2020 23:18:06 +0800 Message-ID: <20200915151805.GA19253@8474a8db62dc> In-Reply-To: <1600138861-187291-1-git-send-email-xuwei5@hisilicon.com> List-Id: --===============0918482522621341089== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kernel test robot drivers/misc/hisi_hikey_usb.c:171: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: Wei Xu Signed-off-by: kernel test robot --- url: https://github.com/0day-ci/linux/commits/Wei-Xu/misc-hisi_hikey_usb= -fix-the-uninitialized-ret/20200915-110654 base: f965d3ec86fa89285db0fbb983da76ba9c398efa hisi_hikey_usb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/misc/hisi_hikey_usb.c +++ b/drivers/misc/hisi_hikey_usb.c @@ -168,10 +168,7 @@ static int hisi_hikey_usb_parse_kirin970 = hisi_hikey_usb->reset =3D devm_gpiod_get(&pdev->dev, "hub_reset_en_gpio", GPIOD_OUT_HIGH); - if (IS_ERR(hisi_hikey_usb->reset)) - return PTR_ERR(hisi_hikey_usb->reset); - - return 0; + return PTR_ERR_OR_ZERO(hisi_hikey_usb->reset); } = static int hisi_hikey_usb_probe(struct platform_device *pdev) --===============0918482522621341089==--