Skip to contentSkip to conversation

check u32 < 0 in hwmon/fscpos.c

PATCH New Eric Sesterhenn / snakebyte 1 participant 1 message Dec 14, 2005

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

PATCH 1/1 check u32 < 0 in hwmon/fscpos.c

hi,

yet another check < 0. Since data->pwm is u8 i removed the check. Maybe v should be u8 and simple_strtoul() casted to u8, so we can remove both checks. If this is the case, i would create a patch to convert all those cases in the file.

drivers/hwmon/fscpos.c renamed from drivers/hwmon/fscpos.c.orig +0 -1
@@ -229,7 +229,6 @@ static ssize_t set_pwm(struct i2c_client
 	unsigned long v = simple_strtoul(buf, NULL, 10);
 
 	/* Range: 0..255 */
-	if (v < 0) v = 0;
 	if (v > 255) v = 255;
 
 	down(&data->update_lock);

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors