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: 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)
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(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
--- 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:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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