]> Pileus Git - ~andy/linux/commit
PCI: Enumerate subordinate buses, not devices, in pci_bus_get_depth()
authorWei Yang <weiyang@linux.vnet.ibm.com>
Fri, 2 Aug 2013 09:31:03 +0000 (17:31 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 2 Aug 2013 22:11:09 +0000 (16:11 -0600)
commitf2a230bd4e1ac4b54ec59dc0b2a246bfe3e89ffe
tree97ca425d564096d164185bb7277c51b21cd9194e
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b
PCI: Enumerate subordinate buses, not devices, in pci_bus_get_depth()

Normally, on one PCI bus there would be more devices than bridges.  When
calculating the depth of a PCI bus, it would be more time efficient to
enumerating through the child buses instead of the child devices.

Also by doing so, the code seems more self explaining.  Previously, it went
through the devices and checked whether a bridge introduced a child bus or
not, which needs more background knowledge to understand it.

This patch calculates the depth by enumerating the bus hierarchy.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/setup-bus.c