Skip to contentSkip to conversation

check u32 < 0 in char/keyboard.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 char/keyboard.c

hi,

another comparison of an unsigned value with < 0 since keycode is always unsigned int in the calling functions i just removed the check.

drivers/char/keyboard.c renamed from drivers/char/keyboard.c.orig +1 -1
@@ -198,7 +198,7 @@ int setkeycode(unsigned int scancode, un
 
 	if (scancode >= dev->keycodemax)
 		return -EINVAL;
-	if (keycode < 0 || keycode > KEY_MAX)
+	if (keycode > KEY_MAX)
 		return -EINVAL;
 	if (dev->keycodesize < sizeof(keycode) && (keycode >> (dev->keycodesize * 8)))
 		return -EINVAL;

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