[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170130173832.GA5608@lkp-ib03.lkp.intel.com>
Date: Tue, 31 Jan 2017 01:38:34 +0800
From: kbuild test robot <lkp@...el.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: kbuild-all@...org, Greg KH <gregkh@...uxfoundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Oliver Neukum <oneukum@...e.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: [PATCH] usb: typec: fix ptr_ret.cocci warnings
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@...ux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.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);
Powered by blists - more mailing lists