diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2012-12-18 21:16:08 -0500 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2012-12-22 05:16:40 -0500 |
| commit | 86266ca0e23b2b8e7e38edda1675cd085a9abc14 (patch) | |
| tree | 409090b0c801c517f9a936a9b15376a82a9de696 | |
| parent | 0602934f302e016e2ea5dc6951681bfac77455ef (diff) | |
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>
| -rw-r--r-- | drivers/hwmon/emc6w201.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/emc6w201.c b/drivers/hwmon/emc6w201.c index a98c917b5888..789bd4fb329b 100644 --- a/drivers/hwmon/emc6w201.c +++ b/drivers/hwmon/emc6w201.c | |||
| @@ -187,7 +187,7 @@ static struct emc6w201_data *emc6w201_update_device(struct device *dev) | |||
| 187 | * Sysfs callback functions | 187 | * Sysfs callback functions |
| 188 | */ | 188 | */ |
| 189 | 189 | ||
| 190 | static const u16 nominal_mv[6] = { 2500, 1500, 3300, 5000, 1500, 1500 }; | 190 | static const s16 nominal_mv[6] = { 2500, 1500, 3300, 5000, 1500, 1500 }; |
| 191 | 191 | ||
| 192 | static ssize_t show_in(struct device *dev, struct device_attribute *devattr, | 192 | static ssize_t show_in(struct device *dev, struct device_attribute *devattr, |
| 193 | char *buf) | 193 | char *buf) |
