[PATCH] ACPI: APD: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Fengguang Wu <fengguang.wu@xxxxxxxxx>

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@xxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

 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 = {
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux