lkml.org 
[lkml]   [2005]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] keyboard: checking the same thing twice is pretty pointless
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);


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

\
 
 \ /
  Last update: 2005-04-23 13:15    [W:0.026 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site