aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/it87.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 0317e441ca51..fc75fcb6bffd 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -198,7 +198,7 @@ static inline u16 FAN16_TO_REG(long rpm)
198static int DIV_TO_REG(int val) 198static int DIV_TO_REG(int val)
199{ 199{
200 int answer = 0; 200 int answer = 0;
201 while ((val >>= 1) != 0) 201 while (answer < 7 && (val >>= 1))
202 answer++; 202 answer++;
203 return answer; 203 return answer;
204} 204}
@@ -563,7 +563,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
563 563
564 struct i2c_client *client = to_i2c_client(dev); 564 struct i2c_client *client = to_i2c_client(dev);
565 struct it87_data *data = i2c_get_clientdata(client); 565 struct it87_data *data = i2c_get_clientdata(client);
566 int val = simple_strtol(buf, NULL, 10); 566 unsigned long val = simple_strtoul(buf, NULL, 10);
567 int i, min[3]; 567 int i, min[3];
568 u8 old; 568 u8 old;
569 569