powerpc/PCI: Use list_for_each_entry() for bus traversal
Replace list_for_each() + pci_bus_b() with list_for_each_entry(). Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:

committed by
Bjorn Helgaas

parent
59c1ad3b82
commit
3bc955987f
@@ -37,15 +37,15 @@ find_bus_among_children(struct pci_bus *bus,
|
||||
struct device_node *dn)
|
||||
{
|
||||
struct pci_bus *child = NULL;
|
||||
struct list_head *tmp;
|
||||
struct pci_bus *tmp;
|
||||
struct device_node *busdn;
|
||||
|
||||
busdn = pci_bus_to_OF_node(bus);
|
||||
if (busdn == dn)
|
||||
return bus;
|
||||
|
||||
list_for_each(tmp, &bus->children) {
|
||||
child = find_bus_among_children(pci_bus_b(tmp), dn);
|
||||
list_for_each_entry(tmp, &bus->children, node) {
|
||||
child = find_bus_among_children(tmp, dn);
|
||||
if (child)
|
||||
break;
|
||||
};
|
||||
|
Reference in New Issue
Block a user