Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (lm95234) fix coccinelle warnings

drivers/hwmon/lm95234.c:704:1-3: WARNING: PTR_RET can be used

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: coccinelle/api/ptr_ret.cocci

CC: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Fengguang Wu and committed by
Guenter Roeck
3ea85ba7 4109a716

+1 -4
+1 -4
drivers/hwmon/lm95234.c
··· 701 701 hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, 702 702 data, 703 703 lm95234_groups); 704 - if (IS_ERR(hwmon_dev)) 705 - return PTR_ERR(hwmon_dev); 706 - 707 - return 0; 704 + return PTR_ERR_OR_ZERO(hwmon_dev); 708 705 } 709 706 710 707 /* Driver data (common to all clients) */