lkml.org 
[lkml]   [2017]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] hwmon: occ: fix err_cast.cocci warnings
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(-)

--- 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;
\
 
 \ /
  Last update: 2017-01-12 08:42    [W:0.107 / U:6.148 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site