From: kernel test robot <[email protected]>

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 <[email protected]>
---

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 via email to