kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [Patch] check u32 < 0 in hwmon/fscpos.c
@ 2005-12-14 16:52 Eric Sesterhenn / snakebyte
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn / snakebyte @ 2005-12-14 16:52 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

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.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.15-rc5-git2/drivers/hwmon/fscpos.c.orig	2005-12-14 17:45:47.000000000 +0100
+++ linux-2.6.15-rc5-git2/drivers/hwmon/fscpos.c	2005-12-14 17:45:53.000000000 +0100
@@ -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);



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-14 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-14 16:52 [KJ] [Patch] check u32 < 0 in hwmon/fscpos.c Eric Sesterhenn / snakebyte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).