Skip to content

Commit

Permalink
ACPI: optimize pci_rootbridge search
Browse files Browse the repository at this point in the history
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: Justin Chen <justin.chen@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Chen, Justin authored and Len Brown committed Oct 27, 2006
1 parent 616362d commit 2f000f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ 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_OK;
status = AE_CTRL_TERMINATE;
}
else
status = AE_OK;
exit:
kfree(buffer.pointer);
return status;
Expand Down

0 comments on commit 2f000f5

Please sign in to comment.