Re: [PATCH v2 3/5] rust: driver: Add ACPI id table support to Adapter trait

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

 



On Fri, Jun 6, 2025 at 2:50 PM Danilo Krummrich <dakr@xxxxxxxxxx> wrote:
> However, I don't understand why we need this and the subsequent
> is_acpi_device_node() and is_of_node() checks.

The idea is to avoid unnecessary table lookups when both OF and ACPI
match tables are present. If we already know the fwnode type, these
simple pointer comparisons (is_acpi_device_node() / is_of_node()) let
us skip the irrelevant match function.

Those checks are cheap (just pointer comparisons), while
acpi_match_device() and of_match_device() iterate over tables.

So yeah, it’s a bit ugly, but it can save some CPU cycles during enumeration.

Thanks,
Igor





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux