linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: kbuild-all@lists.01.org, Clemens Ladisch <clemens@ladisch.de>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] hwmon: fix ptr_ret.cocci warnings
Date: Thu, 10 Sep 2020 06:45:57 +0800	[thread overview]
Message-ID: <20200909224557.GA8954@4a0a5de1ca44> (raw)
In-Reply-To: <202009100651.UfTNs7Q7%lkp@intel.com>

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

drivers/hwmon/k10temp.c:548: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: 11ba5c19102a ("hwmon: (k10temp) Take out debugfs code")
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7204eaa2c1f509066486f488c9dcb065d7484494
commit: 11ba5c19102a4b08f0549026f5491948d4f33d9d [6027/6354] hwmon: (k10temp) Take out debugfs code

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

--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -545,10 +545,7 @@ static int k10temp_probe(struct pci_dev
 	hwmon_dev = devm_hwmon_device_register_with_info(dev, "k10temp", data,
 							 &k10temp_chip_info,
 							 NULL);
-	if (IS_ERR(hwmon_dev))
-		return PTR_ERR(hwmon_dev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
 static const struct pci_device_id k10temp_id_table[] = {

       reply	other threads:[~2020-09-10  2:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202009100651.UfTNs7Q7%lkp@intel.com>
2020-09-09 22:45 ` kernel test robot [this message]
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 ` [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=20200909224557.GA8954@4a0a5de1ca44 \
    --to=lkp@intel.com \
    --cc=clemens@ladisch.de \
    --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 \
    /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).