Guenter Roeck 9ad0df1ada 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>
2016-06-27 18:58:04 -07:00
..
2014-01-29 20:40:08 +01:00
2015-05-31 22:58:36 -07:00
2014-08-04 07:01:35 -07:00
2016-06-27 18:58:04 -07:00
2016-04-19 06:32:38 -07:00
2014-08-04 07:01:36 -07:00
2013-03-18 21:19:49 +01:00
2014-08-05 19:44:42 -07:00
2014-08-04 07:01:35 -07:00
2016-03-05 06:25:34 -08:00
2014-08-04 07:01:35 -07:00
2014-08-04 07:01:35 -07:00
2014-01-29 20:40:08 +01:00
2014-01-29 20:40:08 +01:00
2015-08-10 23:00:10 -07:00
2015-06-21 22:54:53 -07:00