public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: kbuild-all@01.org,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sebastian Reichel <sre@kernel.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Yueyao Zhu <yueyao.zhu@gmail.com>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	linux-usb@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, support.opensource@diasemi.com
Subject: [PATCH] typec: tcpm: fix ptr_ret.cocci warnings
Date: Wed, 20 Dec 2017 23:24:56 +0800	[thread overview]
Message-ID: <20171220152456.GA73368@lkp-g5> (raw)
In-Reply-To: <4a578dd161acf70aa33cc887493d2854547c0a2b.1513599506.git.Adam.Thomson.Opensource@diasemi.com>

From: Fengguang Wu <fengguang.wu@intel.com>

drivers/usb/typec/tcpm.c:4396: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: 91886adfce05 ("typec: tcpm: Represent source supply through power_supply class")
CC: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/usb/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -4393,10 +4393,7 @@ int devm_tcpm_psy_register(struct tcpm_p
 
 	port->psy = devm_power_supply_register(port->dev, &port->psy_desc,
 					       &psy_cfg);
-	if (IS_ERR(port->psy))
-		return PTR_ERR(port->psy);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(port->psy);
 }
 
 struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)

  reply	other threads:[~2017-12-20 15:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 12:41 [PATCH v3 0/7] typec: tcpm: Add sink side support for PPS Adam Thomson
2017-12-18 12:41 ` [PATCH v3 1/7] typec: tcpm: Add PD Rev 3.0 definitions to PD header Adam Thomson
2017-12-20 13:48   ` kbuild test robot
2017-12-18 12:41 ` [PATCH v3 2/7] typec: tcpm: Add ADO header for Alert message handling Adam Thomson
2017-12-18 12:41 ` [PATCH v3 3/7] typec: tcpm: Add SDB header for Status " Adam Thomson
2017-12-18 12:41 ` [PATCH v3 4/7] typec: tcpm: Add core support for sink side PPS Adam Thomson
2017-12-18 12:41 ` [PATCH v3 5/7] power: supply: Add 'connected_type' property and supporting code Adam Thomson
2017-12-18 12:41 ` [PATCH v3 6/7] typec: tcpm: Represent source supply through power_supply class Adam Thomson
2017-12-20 15:24   ` kbuild test robot [this message]
2017-12-20 15:24   ` kbuild test robot
2017-12-18 12:41 ` [PATCH v3 7/7] typec: tcpm: Add support for sink PPS related messages Adam Thomson

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=20171220152456.GA73368@lkp-g5 \
    --to=lkp@intel.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rmfrfs@gmail.com \
    --cc=sre@kernel.org \
    --cc=support.opensource@diasemi.com \
    --cc=yueyao.zhu@gmail.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