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: Justin Chen <justin.chen@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
616362de2f
commit
2f000f5c15
1 changed files with 5 additions and 1 deletions
|
@ -189,8 +189,12 @@ find_pci_rootbridge(acpi_handle handle, u32 lvl, void *context, void **rv)
|
||||||
bus = tmp;
|
bus = tmp;
|
||||||
|
|
||||||
if (seg == find->seg && bus == find->bus)
|
if (seg == find->seg && bus == find->bus)
|
||||||
|
{
|
||||||
find->handle = handle;
|
find->handle = handle;
|
||||||
status = AE_OK;
|
status = AE_CTRL_TERMINATE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = AE_OK;
|
||||||
exit:
|
exit:
|
||||||
kfree(buffer.pointer);
|
kfree(buffer.pointer);
|
||||||
return status;
|
return status;
|
||||||
|
|
Loading…
Reference in a new issue