[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170907100224.GA79024@lkp-wsx02>
Date: Thu, 7 Sep 2017 18:02:24 +0800
From: kbuild test robot <lkp@...el.com>
To: Corentin Chary <corentin.chary@...il.com>
Cc: kbuild-all@...org, Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>, corentin.chary@...il.com,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/x86: fix ptr_ret.cocci warnings
drivers/platform/x86/thinkpad-wmi.c:1205: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: 3af63e23450d ("drivers/x86: add thinkpad-wmi")
CC: Corentin Chary <corentin.chary@...il.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---
thinkpad-wmi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/platform/x86/thinkpad-wmi.c
+++ b/drivers/platform/x86/thinkpad-wmi.c
@@ -1202,9 +1202,7 @@ static int __init thinkpad_wmi_init(void
platform_device = platform_create_bundle(&platform_driver,
thinkpad_wmi_probe,
NULL, 0, NULL, 0);
- if (IS_ERR(platform_device))
- return PTR_ERR(platform_device);
- return 0;
+ return PTR_ERR_OR_ZERO(platform_device);
}
static void __exit thinkpad_wmi_exit(void)
Powered by blists - more mailing lists