]> www.infradead.org Git - users/dwmw2/linux.git/commit
platform/x86: thinkpad_acpi: Change hotkey_reserved_mask initialization
authorHans de Goede <hdegoede@redhat.com>
Wed, 24 Apr 2024 12:28:26 +0000 (14:28 +0200)
committerHans de Goede <hdegoede@redhat.com>
Mon, 29 Apr 2024 09:53:23 +0000 (11:53 +0200)
commitd3272c744518b3ccecec12c1e1dd4366f69d0854
tree2c0ad14b1b34877b16280a0c8049f55dba55036b
parent8f0215401204cff64a9bcaa950002d4456f7c6b3
platform/x86: thinkpad_acpi: Change hotkey_reserved_mask initialization

Change the hotkey_reserved_mask initialization to hardcode the list
of reserved keys. There are only a few reserved keys and the code to
iterate over the keymap will be removed when moving to sparse-keymaps.

Note only the 32 original hotkeys are affected by the hotkey_*_mask values:

if (i < sizeof(hotkey_reserved_mask)*8)
hotkey_reserved_mask |= 1 << i;

The (i < sizeof(hotkey_reserved_mask)*8) condition translates to (i < 32)
so this code only ever set bits in hotkey_reserved_mask for the 32 original
hotkeys. Therefor this patch does not set any bits in hotkey_reserved_mask
for the KEY_RESERVED mappings for the adaptive keyboard scancodes.

Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240424122834.19801-17-hdegoede@redhat.com
drivers/platform/x86/thinkpad_acpi.c