sysrq: attach sysrq handler correctly for 32-bit kernel
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 5 Jan 2017 17:14:16 +0000 (02:14 +0900)
committerJiri Slaby <jslaby@suse.cz>
Thu, 26 Jan 2017 16:40:43 +0000 (17:40 +0100)
commit7ba4dcddd51c419828a2477e9dc2dff9d32550fe
tree4d399f096e493d565ef52e6da1cc5a979a2ef312
parent955f82ec9a0a251ed1ebe16ce0efd564337ce439
sysrq: attach sysrq handler correctly for 32-bit kernel

commit 802c03881f29844af0252b6e22be5d2f65f93fd0 upstream.

The sysrq input handler should be attached to the input device which has
a left alt key.

On 32-bit kernels, some input devices which has a left alt key cannot
attach sysrq handler.  Because the keybit bitmap in struct input_device_id
for sysrq is not correctly initialized.  KEY_LEFTALT is 56 which is
greater than BITS_PER_LONG on 32-bit kernels.

I found this problem when using a matrix keypad device which defines
a KEY_LEFTALT (56) but doesn't have a KEY_O (24 == 56%32).

Cc: Jiri Slaby <jslaby@suse.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/tty/sysrq.c