linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, djkurtz@chromium.org, akshu.agrawal@amd.com,
	Alexander.Deucher@amd.com,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	"open list:ACPI" <linux-acpi@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: [PATCH] ACPI: APD: fix ptr_ret.cocci warnings
Date: Sat, 5 May 2018 04:16:06 +0800	[thread overview]
Message-ID: <20180504201606.GA22737@lkp-wsm-ep1> (raw)
In-Reply-To: <1525422930-27826-2-git-send-email-akshu.agrawal@amd.com>

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

      parent reply	other threads:[~2018-05-04 20:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1525422930-27826-1-git-send-email-akshu.agrawal@amd.com>
2018-05-04  8:34 ` [PATCH v2 2/2] ACPI: APD: Add AMD misc clock handler support Akshu Agrawal
2018-05-04 10:06   ` Rafael J. Wysocki
2018-05-04 10:09     ` Agrawal, Akshu
2018-05-04 10:15       ` Rafael J. Wysocki
2018-05-04 10:23         ` Agrawal, Akshu
2018-05-04 11:07           ` Rafael J. Wysocki
2018-05-04 17:11             ` Agrawal, Akshu
2018-05-04 20:16   ` kbuild test robot
2018-05-04 20:16   ` kbuild test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180504201606.GA22737@lkp-wsm-ep1 \
    --to=lkp@intel.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=akshu.agrawal@amd.com \
    --cc=djkurtz@chromium.org \
    --cc=kbuild-all@01.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).