From: kernel test robot <lkp@intel.com>
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 [thread overview]
Message-ID: <20200915151805.GA19253@8474a8db62dc> (raw)
In-Reply-To: <1600138861-187291-1-git-send-email-xuwei5@hisilicon.com>
[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]
From: kernel test robot <lkp@intel.com>
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 <xuwei5@hisilicon.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
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 = 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)
prev parent reply other threads:[~2020-09-15 15:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 3:01 [PATCH] misc: hisi_hikey_usb: fix the uninitialized ret Wei Xu
2020-09-15 15:18 ` kernel test robot
2020-09-15 15:18 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200915151805.GA19253@8474a8db62dc \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.