linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: kbuild-all@01.org, Greg KH <gregkh@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Oliver Neukum <oneukum@suse.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [PATCH] usb: typec: fix ptr_ret.cocci warnings
Date: Tue, 31 Jan 2017 01:38:34 +0800	[thread overview]
Message-ID: <20170130173832.GA5608@lkp-ib03.lkp.intel.com> (raw)
In-Reply-To: <20170130124924.47634-4-heikki.krogerus@linux.intel.com>

drivers/usb/typec/typec.c:1249: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: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 typec.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -1246,9 +1246,7 @@ EXPORT_SYMBOL_GPL(typec_unregister_port)
 static int __init typec_init(void)
 {
 	typec_class = class_create(THIS_MODULE, "typec");
-	if (IS_ERR(typec_class))
-		return PTR_ERR(typec_class);
-	return 0;
+	return PTR_ERR_OR_ZERO(typec_class);
 }
 subsys_initcall(typec_init);
 

  parent reply	other threads:[~2017-01-30 17:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 12:49 [PATCH v16 0/3] USB Type-C Connector class Heikki Krogerus
2017-01-30 12:49 ` [PATCH v16 1/3] lib/string: add sysfs_match_string helper Heikki Krogerus
2017-01-30 12:49 ` [PATCH v16 2/3] usb: USB Type-C connector class Heikki Krogerus
2017-01-30 12:49 ` [PATCH v16 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY Heikki Krogerus
2017-01-30 17:38   ` kbuild test robot
2017-01-30 17:38   ` kbuild test robot [this message]
2017-02-10 15:17     ` [PATCH] usb: typec: fix ptr_ret.cocci warnings Heikki Krogerus
2017-02-05 20:50 ` [PATCH v16 0/3] USB Type-C Connector class Guenter Roeck

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=20170130173832.GA5608@lkp-ib03.lkp.intel.com \
    --to=lkp@intel.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mika.westerberg@linux.intel.com \
    --cc=oneukum@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).