linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Naveen Krishna Chatradhi <nchatrad@amd.com>
Cc: kbuild-all@lists.01.org, linux-hwmon@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] hwmon: fix ptr_ret.cocci warnings
Date: Sun, 4 Oct 2020 14:37:55 +0800	[thread overview]
Message-ID: <20201004063755.GA47627@fe6c56ecaa6d> (raw)
In-Reply-To: <202010041453.4f94XEJB-lkp@intel.com>

From: kernel test robot <lkp@intel.com>

drivers/hwmon/amd_energy.c:302: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: 911766432fd2 ("hwmon: (amd_energy) Improve the accumulation logic")
CC: Naveen Krishna Chatradhi <nchatrad@amd.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   78a28192e301da58ac408f2e98fa30aebafbfda0
commit: 911766432fd2a6054d9813845ad3f48120bd649c [45/55] hwmon: (amd_energy) Improve the accumulation logic

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

--- a/drivers/hwmon/amd_energy.c
+++ b/drivers/hwmon/amd_energy.c
@@ -299,10 +299,7 @@ static int amd_energy_probe(struct platf
 
 	data->wrap_accumulate = kthread_run(energy_accumulator, data,
 					    "%s", dev_name(hwmon_dev));
-	if (IS_ERR(data->wrap_accumulate))
-		return PTR_ERR(data->wrap_accumulate);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(data->wrap_accumulate);
 }
 
 static int amd_energy_remove(struct platform_device *pdev)

  reply	other threads:[~2020-10-04  6:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04  6:37 [hwmon:hwmon-next 45/55] drivers/hwmon/amd_energy.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
2020-10-04  6:37 ` kernel test robot [this message]
     [not found] <202009100651.UfTNs7Q7%lkp@intel.com>
2020-09-09 22:45 ` [PATCH] hwmon: fix ptr_ret.cocci warnings kernel test robot

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=20201004063755.GA47627@fe6c56ecaa6d \
    --to=lkp@intel.com \
    --cc=jdelvare@suse.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nchatrad@amd.com \
    /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).