lkml.org 
[lkml]   [2018]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ACPI: APD: fix ptr_ret.cocci warnings
From: Fengguang Wu <fengguang.wu@intel.com>

drivers/acpi/acpi_apd.c:114: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: 451cec30ec2b ("ACPI: APD: Add AMD misc clock handler support")
CC: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -111,10 +111,7 @@ static int st_misc_setup(struct apd_priv
clkdev = platform_device_register_data(&adev->dev, "clk-st",
PLATFORM_DEVID_NONE, clk_data,
sizeof(*clk_data));
- if (IS_ERR(clkdev))
- return PTR_ERR(clkdev);
-
- return 0;
+ return PTR_ERR_OR_ZERO(clkdev);
}

static const struct apd_device_desc cz_i2c_desc = {
\
 
 \ /
  Last update: 2018-05-04 22:17    [W:0.089 / U:4.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site