Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f000f5c authored by Chen, Justin's avatar Chen, Justin Committed by Len Brown
Browse files

ACPI: optimize pci_rootbridge search



acpi_get_pci_rootbridge_handle() walks the ACPI name space
searching for seg, bus and the PCI_ROOT_HID_STRING --
returning the handle as soon as if find the match.

But the current codes always parses through the whole namespace because
the user_function find_pci_rootbridge() returns status=AE_OK when it finds the match.

Make the find_pci_rootbridge() return AE_CTRL_TERMINATE when it finds the match.
This reduces the ACPI namespace walk for acpi_get_pci_rootbridge_handle().

Signed-off-by: default avatarJustin Chen <justin.chen@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 616362de
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -189,7 +189,11 @@ find_pci_rootbridge(acpi_handle handle, u32 lvl, void *context, void **rv)
	bus = tmp;

	if (seg == find->seg && bus == find->bus)
	{
		find->handle = handle;
		status = AE_CTRL_TERMINATE;
	}
	else
		status = AE_OK;
      exit:
	kfree(buffer.pointer);