[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171220152456.GA73368@lkp-g5>
Date: Wed, 20 Dec 2017 23:24:56 +0800
From: kbuild test robot <lkp@...el.com>
To: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
Cc: kbuild-all@...org,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Guenter Roeck <linux@...ck-us.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sebastian Reichel <sre@...nel.org>,
Hans de Goede <hdegoede@...hat.com>,
Yueyao Zhu <yueyao.zhu@...il.com>,
Rui Miguel Silva <rmfrfs@...il.com>,
linux-usb@...r.kernel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, support.opensource@...semi.com
Subject: [PATCH] typec: tcpm: fix ptr_ret.cocci warnings
From: Fengguang Wu <fengguang.wu@...el.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@...semi.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.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)
Powered by blists - more mailing lists