Skip to contentSkip to conversation

hwmon: (w83793) Clean up a signedness issue

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 19, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (w83793) Clean up a signedness issue

We cap the upper bound of "mtimeout" but since it's signed we should check for negative values as well. The mistake is harmless. But I have changed it to unsigned as a cleanup.

drivers/hwmon/w83793.c +2 -1
index b6470ec..9d63d71 100644
@@ -1199,7 +1199,8 @@ static void w83793_init_client(struct i2c_client *client)
 
 static int watchdog_set_timeout(struct w83793_data *data, int timeout)
 {
-	int ret, mtimeout;
+	unsigned int mtimeout;
+	int ret;
 
 	mtimeout = DIV_ROUND_UP(timeout, 60);
 
maintainer Applied
#1 lore raw
Quoted 6 lines · Dan Carpenter

We cap the upper bound of "mtimeout" but since it's signed we should check for negative values as well. The mistake is harmless. But I have changed it to unsigned as a cleanup.

Applied to -next.

Thanks,
Guenter