lkml.org 
[lkml]   [2017]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.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)
\
 
 \ /
  Last update: 2017-09-07 12:03    [W:1.163 / U:0.516 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site