Skip to content

Commit

Permalink
hwmon: (nct6775) mask out bank number in nct6775_wmi_read_value()
Browse files Browse the repository at this point in the history
The first call to nct6775_asuswmi_read() in nct6775_wmi_read_value()
had been passing the full bank+register number instead of just the
lower 8 bits.  It didn't end up actually causing problems because the
second argument of that function is a u8 anyway, but it seems
preferable to be explicit about it at the call site (and consistent
with the rest of the code).

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Fixes: 3fbbfc2 ("hwmon: (nct6775) Support access via Asus WMI")
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20211111025339.27520-1-zev@bewilderbeest.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Zev Weiss authored and Guenter Roeck committed Nov 15, 2021
1 parent dbd3e6e commit 214f525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ static u16 nct6775_wmi_read_value(struct nct6775_data *data, u16 reg)

nct6775_wmi_set_bank(data, reg);

err = nct6775_asuswmi_read(data->bank, reg, &tmp);
err = nct6775_asuswmi_read(data->bank, reg & 0xff, &tmp);
if (err)
return 0;

Expand Down

0 comments on commit 214f525

Please sign in to comment.