Message ID | 20171205143726.d3tziwhjboyfxmgi@mwanda (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Tue, Dec 05, 2017 at 05:37:26PM +0300, Dan Carpenter wrote: > Shift has higher precedence than mask but presumably we wanted to set > *val to 1 if BIT(2) was set or 0 if the bit was clear. > > Fixes: de0a524e3e09 ("hwmon: Add W83773G driver") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Hi Dan, I already queued up the fix after my own builders reported the problem. Thanks, Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; }
Shift has higher precedence than mask but presumably we wanted to set *val to 1 if BIT(2) was set or 0 if the bit was clear. Fixes: de0a524e3e09 ("hwmon: Add W83773G driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html