[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200909224557.GA8954@4a0a5de1ca44>
Date: Thu, 10 Sep 2020 06:45:57 +0800
From: kernel test robot <lkp@...el.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: kbuild-all@...ts.01.org, Clemens Ladisch <clemens@...isch.de>,
Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] hwmon: fix ptr_ret.cocci warnings
From: kernel test robot <lkp@...el.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@...el.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[] = {
Powered by blists - more mailing lists