Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 571e3f3a authored by Guenter Roeck's avatar Guenter Roeck
Browse files

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: default avatarLei YU <mine260309@gmail.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent a7a9b15a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}