On 6/6/25 5:29 PM, Greg Kroah-Hartman wrote:
On Fri, Jun 06, 2025 at 03:26:13PM +0100, Igor Korotin wrote:
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.
You have loads of CPU cycles during enumeration, keep things simple
first, only attempt to optimize things later on if it is actually
measureable.
I'm fine either way, I don't expect much value in optimizing this and at the
same time I don't see doing it adds significant complexity either.
If Greg prefers not to have this optimization to begin with, let's go without
it please.