diff mbox

hwmon: occ: fix err_cast.cocci warnings

Message ID 20170112073956.GA29782@lkp-ib03.lkp.intel.com
State Not Applicable
Headers show

Commit Message

kernel test robot Jan. 12, 2017, 7:39 a.m. UTC
drivers/hwmon/occ/occ_sysfs.c:265:9-16: WARNING: ERR_CAST can be used with hwmon -> dev


 Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Generated by: scripts/coccinelle/api/err_cast.cocci

CC: Edward A. James <eajames@us.ibm.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 occ_sysfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/hwmon/occ/occ_sysfs.c
+++ b/drivers/hwmon/occ/occ_sysfs.c
@@ -262,7 +262,7 @@  struct occ_sysfs *occ_sysfs_start(struct
 	if (IS_ERR(hwmon->dev)) {
 		dev_err(dev, "cannot register hwmon device %s: %ld\n",
 			hwmon->hwmon_name, PTR_ERR(hwmon->dev));
-		return ERR_PTR(PTR_ERR(hwmon->dev));
+		return ERR_CAST(hwmon->dev);
 	}
 
 	return hwmon;