]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (emc6w201) Fix DIV_ROUND_CLOSEST problem with unsigned divisors
authorGuenter Roeck <linux@roeck-us.net>
Wed, 19 Dec 2012 02:16:08 +0000 (18:16 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 22 Dec 2012 10:16:40 +0000 (02:16 -0800)
commit600f892ca50f76bbeb735b9de41063edfad07344
tree409090b0c801c517f9a936a9b15376a82a9de696
parent52ed796113c5c9bf4e84c244c7144bb1a6fe398f
hwmon: (emc6w201) Fix DIV_ROUND_CLOSEST problem with unsigned divisors

Result of DIV_ROUND_CLOSEST is undefined for negative dividends if the divisor
variable type is unsigned. Fix by declaring divisor as signed variable.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/emc6w201.c