linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* typec: tcpm: fix ptr_ret.cocci warnings
@ 2017-12-20 15:24 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2017-12-20 15:24 UTC (permalink / raw)
  To: Adam Thomson
  Cc: kbuild-all, Heikki Krogerus, Guenter Roeck, Greg Kroah-Hartman,
	Sebastian Reichel, Hans de Goede, Yueyao Zhu, Rui Miguel Silva,
	linux-usb, linux-pm, linux-kernel, support.opensource

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-20 15:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-20 15:24 typec: tcpm: fix ptr_ret.cocci warnings kbuild test robot

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).