Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569941
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] usb: typec: fix ptr_ret.cocci warnings |
| Date | 2017-01-30 18:40 +0100 |
| Message-ID | <t5o5Q-6Mu-17@gated-at.bofh.it> (permalink) |
| References | <t5o5Q-6Mu-19@gated-at.bofh.it> <t5jIT-45O-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
drivers/usb/typec/typec.c:1249: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
CC: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
typec.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -1246,9 +1246,7 @@ EXPORT_SYMBOL_GPL(typec_unregister_port)
static int __init typec_init(void)
{
typec_class = class_create(THIS_MODULE, "typec");
- if (IS_ERR(typec_class))
- return PTR_ERR(typec_class);
- return 0;
+ return PTR_ERR_OR_ZERO(typec_class);
}
subsys_initcall(typec_init);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v16 0/3] USB Type-C Connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-01-30 13:50 +0100
[PATCH v16 1/3] lib/string: add sysfs_match_string helper Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-01-30 14:00 +0100
[PATCH v16 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-01-30 14:00 +0100
[PATCH] usb: typec: fix ptr_ret.cocci warnings kbuild test robot <lkp@intel.com> - 2017-01-30 18:40 +0100
Re: [PATCH] usb: typec: fix ptr_ret.cocci warnings Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-02-10 16:30 +0100
Re: [PATCH v16 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY kbuild test robot <lkp@intel.com> - 2017-01-30 18:50 +0100
Re: [PATCH v16 0/3] USB Type-C Connector class Guenter Roeck <linux@roeck-us.net> - 2017-02-05 22:00 +0100
csiph-web