Re: [PATCH v2 16/24] platform/x86: thinkpad_acpi: Change hotkey_reserved_mask initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Apr 2024, Hans de Goede wrote:
>
> Thank you for reviewing this series.
> 
> On 4/25/24 11:14 AM, Ilpo Järvinen wrote:
> > On Wed, 24 Apr 2024, Hans de Goede wrote:
> > 
> >> 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.
> > 
> > Hi,
> > 
> > Consider extending this explanation. It's hard to see how the old and new 
> > code are identical because there are more KEY_RESERVED entries in the 
> > array than in the new code. I can see the list of keys in the new code 
> > matches to those set using tpacpi_hotkey_driver_mask_set() but it's hard 
> > to connect the dots here.
> 
> Right, this is basically the same question as which Mark asked. I've added
> the following to the commit message while merging this series to clarify this:
> 
> """
> Note only the 32 original hotkeys are affected by any of the hotkey_*_mask
> values, note:
> 
>         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.
> """

Thanks for adding it, very clear now!

-- 
 i.

[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux