summaryrefslogtreecommitdiffstats
path: root/drivers/pci/search.c
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2014-02-13 21:14:03 +0800
committerBjorn Helgaas <bhelgaas@google.com>2014-02-14 12:32:26 -0700
commit94e6a9b93064b49024b8701d2d81fcb4a821fa09 (patch)
treeb37fc0e841611cdd529c092184857e303e8aee66 /drivers/pci/search.c
parent560698e9d2ca77d0adb07f3cf0ebfe519859c528 (diff)
downloadlinux-94e6a9b93064b49024b8701d2d81fcb4a821fa09.tar.gz
linux-94e6a9b93064b49024b8701d2d81fcb4a821fa09.tar.bz2
linux-94e6a9b93064b49024b8701d2d81fcb4a821fa09.zip
PCI: Remove pci_bus_b() and use list_for_each_entry() directly
Replace list_for_each() with list_for_each_entry(), which means we no longer need pci_bus_b() and can remove it. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r--drivers/pci/search.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 3ff2ac7c14e2..4a1b972efe7f 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -54,14 +54,14 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)
{
- struct pci_bus* child;
- struct list_head *tmp;
+ struct pci_bus *child;
+ struct pci_bus *tmp;
if(bus->number == busnr)
return bus;
- list_for_each(tmp, &bus->children) {
- child = pci_do_find_bus(pci_bus_b(tmp), busnr);
+ list_for_each_entry(tmp, &bus->children, node) {
+ child = pci_do_find_bus(tmp, busnr);
if(child)
return child;
}
@@ -111,7 +111,7 @@ pci_find_next_bus(const struct pci_bus *from)
down_read(&pci_bus_sem);
n = from ? from->node.next : pci_root_buses.next;
if (n != &pci_root_buses)
- b = pci_bus_b(n);
+ b = list_entry(n, struct pci_bus, node);
up_read(&pci_bus_sem);
return b;
}