diff mbox

ACPI: APD: fix ptr_ret.cocci warnings

Message ID 20180504201606.GA22737@lkp-wsm-ep1 (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

kernel test robot May 4, 2018, 8:16 p.m. UTC
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(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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 = {