提交 571e3f3a 编写于 作者: G Guenter Roeck

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: NLei YU <mine260309@gmail.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 a7a9b15a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册