diff options
author | Guenter Roeck <linux@roeck-us.net> | 2016-06-24 19:41:57 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2016-06-27 18:58:04 -0700 |
commit | 9ad0df1adac20d694fbb8e7cb7bac04e0645a927 (patch) | |
tree | 49f518ce469dd8fc3636d65ffccd28899741c098 /Documentation/hwmon | |
parent | 51b8c2cd92f1b59657a13339dffcca79c76126d1 (diff) | |
download | linux-stable-9ad0df1adac20d694fbb8e7cb7bac04e0645a927.tar.gz linux-stable-9ad0df1adac20d694fbb8e7cb7bac04e0645a927.tar.bz2 linux-stable-9ad0df1adac20d694fbb8e7cb7bac04e0645a927.zip |
hwmon: (ina3221) Fix negative limits
The result of an integer divide by an unsigned is undefined.
This causes unexpected results when writing negative values
into the limit registers.
Maintain the shunt_resistors variables as signed integer to avoid
the problem. Also, for simplicity and ease of use, clamp shunt
resistor value on writes instead of rejecting bad values.
Cc: Andrew F. Davis <afd@ti.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'Documentation/hwmon')
0 files changed, 0 insertions, 0 deletions