public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
	huangdaode <huangdaode@hisilicon.com>,
	Kenneth Lee <liguozhu@huawei.com>,
	Yisen Zhuang <Yisen.Zhuang@huawei.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] net: hisilicon: fix ptr_ret.cocci warnings
Date: Tue, 20 Oct 2015 14:56:00 +0800	[thread overview]
Message-ID: <20151020065600.GA104525@lkp-ib03> (raw)
In-Reply-To: <201510201454.XwPbNrDe%fengguang.wu@intel.com>

drivers/net/ethernet/hisilicon/hns/hnae.c:442: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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/net/ethernet/hisilicon/hns/hnae.c
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.c
@@ -439,10 +439,7 @@ EXPORT_SYMBOL(hnae_ae_unregister);
 static int __init hnae_init(void)
 {
 	hnae_class = class_create(THIS_MODULE, "hnae");
-	if (IS_ERR(hnae_class))
-		return PTR_ERR(hnae_class);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hnae_class);
 }
 
 static void __exit hnae_exit(void)

  reply	other threads:[~2015-10-20  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20  6:56 [net-next:master 241/245] drivers/net/ethernet/hisilicon/hns/hnae.c:442:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2015-10-20  6:56 ` kbuild test robot [this message]
2015-10-22  2:38   ` [PATCH] net: hisilicon: fix ptr_ret.cocci warnings David Miller

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=20151020065600.GA104525@lkp-ib03 \
    --to=fengguang.wu@intel.com \
    --cc=Yisen.Zhuang@huawei.com \
    --cc=arnd@arndb.de \
    --cc=huangdaode@hisilicon.com \
    --cc=kbuild-all@01.org \
    --cc=liguozhu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox