From: Arve Hjønnevåg Date: Wed, 15 Jul 2009 03:58:41 +0000 (-0700) Subject: Input: gpio_input: Fix keys with keycode 0x100-0x1ff X-Git-Tag: firefly_0821_release~9833^2~5^2~314 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e7f3240267596863fb10f4d0932beab422b4b095;p=firefly-linux-kernel-4.4.55.git Input: gpio_input: Fix keys with keycode 0x100-0x1ff KEY_MAX is no longer a power of 2. Signed-off-by: Arve Hjønnevåg --- 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++) {