From e7f3240267596863fb10f4d0932beab422b4b095 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= Date: Tue, 14 Jul 2009 20:58:41 -0700 Subject: [PATCH] Input: gpio_input: Fix keys with keycode 0x100-0x1ff MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit KEY_MAX is no longer a power of 2. Signed-off-by: Arve Hjønnevåg --- drivers/input/misc/gpio_matrix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/gpio_matrix.c b/drivers/input/misc/gpio_matrix.c index 441cc1ce1ab7..10b441101668 100644 --- a/drivers/input/misc/gpio_matrix.c +++ b/drivers/input/misc/gpio_matrix.c @@ -316,9 +316,8 @@ int gpio_event_matrix_func(struct input_dev *input_dev, kp->keypad_info = mi; set_bit(EV_KEY, input_dev->evbit); for (i = 0; i < key_count; i++) { - if (mi->keymap[i]) - set_bit(mi->keymap[i] & KEY_MAX, - input_dev->keybit); + if (mi->keymap[i] && mi->keymap[i] <= KEY_MAX) + set_bit(mi->keymap[i], input_dev->keybit); } for (i = 0; i < mi->noutputs; i++) { -- 2.34.1