summaryrefslogtreecommitdiff
path: root/Documentation/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-06-25 05:41:57 +0300
committerGuenter Roeck <linux@roeck-us.net>2016-06-28 04:58:04 +0300
commit9ad0df1adac20d694fbb8e7cb7bac04e0645a927 (patch)
tree49f518ce469dd8fc3636d65ffccd28899741c098 /Documentation/hwmon
parent51b8c2cd92f1b59657a13339dffcca79c76126d1 (diff)
downloadlinux-9ad0df1adac20d694fbb8e7cb7bac04e0645a927.tar.xz
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