aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2017-12-03 15:27:56 -0800
committerGuenter Roeck <linux@roeck-us.net>2018-01-02 15:05:34 -0800
commit571e3f3a8e6582ecce2c7fd5d0a9e2ae74cece02 (patch)
tree1e9fa4097eb343ac524f4e2ddc35ec5288f9ef91 /drivers/hwmon
parenthwmon: (hih6130) Fix documentation of struct hih6130 (diff)
downloadlinux-dev-571e3f3a8e6582ecce2c7fd5d0a9e2ae74cece02.tar.xz
linux-dev-571e3f3a8e6582ecce2c7fd5d0a9e2ae74cece02.zip
hwmon: (w83773g) Fix fault detection and reporting
Smatch reports: drivers/hwmon/w83773g.c:105 get_fault() warn: shift has higher precedence than mask Code analysis shows that the code is indeed wrong. Fix it, and while we are at it, drop unnecessary typecast. Fixes: 86a10c802362 ("hwmon: Add W83773G driver") Cc: Lei YU <mine260309@gmail.com> Reviewed-by: Lei YU <mine260309@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/w83773g.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/w83773g.c b/drivers/hwmon/w83773g.c
index 0b97c285b049..e858093ac806 100644
--- a/drivers/hwmon/w83773g.c
+++ b/drivers/hwmon/w83773g.c
@@ -102,7 +102,7 @@ static int get_fault(struct regmap *regmap, int index, long *val)
if (ret < 0)
return ret;
- *val = (u8)regval & 0x04 >> 2;
+ *val = (regval & 0x04) >> 2;
return 0;
}