[PATCH] keyboard: checking the same thing twice is pretty pointless

From: Jesper Juhl
Date: Sat Apr 23 2005 - 06:12:55 EST


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@xxxxxx>
---

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);



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/