public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel_cht_int33fe: fix ptr_ret.cocci warnings
  2019-04-17  0:52 [pm:bleeding-edge 80/85] drivers/platform/x86/intel_cht_int33fe.c:98:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
@ 2019-04-17  0:52 ` kbuild test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2019-04-17  0:52 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: kbuild-all, linux-acpi, devel, linux-pm, Rafael J. Wysocki

From: kbuild test robot <lkp@intel.com>

drivers/platform/x86/intel_cht_int33fe.c:98: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: 7ea0bcd16565 ("platform/x86: intel_cht_int33fe: Register max17047 in its own function")
CC: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head:   98438d88cbe65037744bdc071720389797f9c575
commit: 7ea0bcd165658c84544d5f241126b782d14fbb7f [80/85] platform/x86: intel_cht_int33fe: Register max17047 in its own function

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

--- a/drivers/platform/x86/intel_cht_int33fe.c
+++ b/drivers/platform/x86/intel_cht_int33fe.c
@@ -95,10 +95,7 @@ cht_int33fe_register_max17047(struct dev
 	board_info.dev_name = "max17047";
 	board_info.properties = max17047_props;
 	data->max17047 = i2c_acpi_new_device(dev, 1, &board_info);
-	if (IS_ERR(data->max17047))
-		return PTR_ERR(data->max17047);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(data->max17047);
 }
 
 static const struct property_entry fusb302_props[] = {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pm:bleeding-edge 80/85] drivers/platform/x86/intel_cht_int33fe.c:98:1-3: WARNING: PTR_ERR_OR_ZERO can be used
@ 2019-04-17  0:52 kbuild test robot
  2019-04-17  0:52 ` [PATCH] platform/x86: intel_cht_int33fe: fix ptr_ret.cocci warnings kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2019-04-17  0:52 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: kbuild-all, linux-acpi, devel, linux-pm, Rafael J. Wysocki

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head:   98438d88cbe65037744bdc071720389797f9c575
commit: 7ea0bcd165658c84544d5f241126b782d14fbb7f [80/85] platform/x86: intel_cht_int33fe: Register max17047 in its own function


coccinelle warnings: (new ones prefixed by >>)

>> drivers/platform/x86/intel_cht_int33fe.c:98:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-17  0:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-17  0:52 [pm:bleeding-edge 80/85] drivers/platform/x86/intel_cht_int33fe.c:98:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2019-04-17  0:52 ` [PATCH] platform/x86: intel_cht_int33fe: 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