* [PATCH] keyboard: checking the same thing twice is pretty pointless
@ 2005-04-23 11:14 Jesper Juhl
0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2005-04-23 11:14 UTC (permalink / raw)
To: Vojtech Pavlik; +Cc: linux-kernel
in drivers/char/keyboard.c::setkeycode two 'if' statements test exately
the same thing - one of them should go away, I removed the second one.
Since 'keycode' is an unsigned int it can never be <0 and the >KEY_MAX
check has just been performed by the 'if' above.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
---
drivers/char/keyboard.c | 2 --
1 files changed, 2 deletions(-)
--- linux-2.6.12-rc2-mm3-orig/drivers/char/keyboard.c 2005-04-11 21:20:40.000000000 +0200
+++ linux-2.6.12-rc2-mm3/drivers/char/keyboard.c 2005-04-23 12:43:28.000000000 +0200
@@ -200,8 +200,6 @@ int setkeycode(unsigned int scancode, un
return -EINVAL;
if (keycode > KEY_MAX)
return -EINVAL;
- if (keycode < 0 || keycode > KEY_MAX)
- return -EINVAL;
oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-23 11:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-23 11:14 [PATCH] keyboard: checking the same thing twice is pretty pointless Jesper Juhl
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).