30 Jun 21:33
[PATCH] input: push down scancode negative checking
From: Daniel Walker <dwalker <at> mvista.com>
Subject: [PATCH] input: push down scancode negative checking
Newsgroups: gmane.linux.kernel.input
Date: 2008-06-30 19:33:46 GMT
Subject: [PATCH] input: push down scancode negative checking
Newsgroups: gmane.linux.kernel.input
Date: 2008-06-30 19:33:46 GMT
The getkeycode/setkeycode calls should be able to accept "negative" values. The HID layer has some scan codes of the form 0xffbc0000 for logitech devices, and they get ignored by these calls. I pushed the checking into the input_default_* functions since they do need non-negative values. I also corrected a typo in the comment for input_set_keycode Signed-off-by: Daniel Walker <dwalker <at> mvista.com> --- drivers/input/input.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 27006fc..e1af21f 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -526,7 +526,7 @@ static int input_default_getkeycode(struct input_dev *dev, if (!dev->keycodesize) return -EINVAL; - if (scancode >= dev->keycodemax) + if (scancode < 0 || scancode >= dev->keycodemax) return -EINVAL; *keycode = input_fetch_keycode(dev, scancode); @@ -540,7 +540,7 @@ static int input_default_setkeycode(struct input_dev *dev, int old_keycode; int i;(Continue reading)
RSS Feed