Commit ce6fd84f authored by Maximilian Attems's avatar Maximilian Attems Committed by Greg Kroah-Hartman

[PATCH] PCI list_for_each: arch-ppc-kernel-pci.c

s/for/list_for_each/
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent d503a9fc
...@@ -231,14 +231,12 @@ EXPORT_SYMBOL(pcibios_align_resource); ...@@ -231,14 +231,12 @@ EXPORT_SYMBOL(pcibios_align_resource);
static void __init static void __init
pcibios_allocate_bus_resources(struct list_head *bus_list) pcibios_allocate_bus_resources(struct list_head *bus_list)
{ {
struct list_head *ln;
struct pci_bus *bus; struct pci_bus *bus;
int i; int i;
struct resource *res, *pr; struct resource *res, *pr;
/* Depth-First Search on bus tree */ /* Depth-First Search on bus tree */
for (ln = bus_list->next; ln != bus_list; ln=ln->next) { list_for_each_entry(bus, bus_list, node) {
bus = pci_bus_b(ln);
for (i = 0; i < 4; ++i) { for (i = 0; i < 4; ++i) {
if ((res = bus->resource[i]) == NULL || !res->flags if ((res = bus->resource[i]) == NULL || !res->flags
|| res->start > res->end) || res->start > res->end)
...@@ -381,7 +379,6 @@ probe_resource(struct pci_bus *parent, struct resource *pr, ...@@ -381,7 +379,6 @@ probe_resource(struct pci_bus *parent, struct resource *pr,
struct pci_bus *bus; struct pci_bus *bus;
struct pci_dev *dev; struct pci_dev *dev;
struct resource *r; struct resource *r;
struct list_head *ln;
int i; int i;
for (r = pr->child; r != NULL; r = r->sibling) { for (r = pr->child; r != NULL; r = r->sibling) {
...@@ -390,9 +387,7 @@ probe_resource(struct pci_bus *parent, struct resource *pr, ...@@ -390,9 +387,7 @@ probe_resource(struct pci_bus *parent, struct resource *pr,
return 1; return 1;
} }
} }
for (ln = parent->children.next; ln != &parent->children; list_for_each_entry(bus, &parent->children, node) {
ln = ln->next) {
bus = pci_bus_b(ln);
for (i = 0; i < 4; ++i) { for (i = 0; i < 4; ++i) {
if ((r = bus->resource[i]) == NULL) if ((r = bus->resource[i]) == NULL)
continue; continue;
...@@ -406,8 +401,7 @@ probe_resource(struct pci_bus *parent, struct resource *pr, ...@@ -406,8 +401,7 @@ probe_resource(struct pci_bus *parent, struct resource *pr,
} }
} }
} }
for (ln = parent->devices.next; ln != &parent->devices; ln=ln->next) { list_for_each_entry(dev, &parent->devices, bus_list) {
dev = pci_dev_b(ln);
for (i = 0; i < 6; ++i) { for (i = 0; i < 6; ++i) {
r = &dev->resource[i]; r = &dev->resource[i];
if (!r->flags || (r->flags & IORESOURCE_UNSET)) if (!r->flags || (r->flags & IORESOURCE_UNSET))
...@@ -1102,7 +1096,7 @@ do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga) ...@@ -1102,7 +1096,7 @@ do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
static int __init static int __init
check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga) check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
{ {
struct list_head *ln; struct pci_dev *dev;
int i; int i;
int rc = 0; int rc = 0;
...@@ -1110,8 +1104,7 @@ check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga) ...@@ -1110,8 +1104,7 @@ check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \ res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
} while (0) } while (0)
for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) { list_for_each_entry(dev, &bus->devices, bus_list) {
struct pci_dev *dev = pci_dev_b(ln);
u16 class = dev->class >> 8; u16 class = dev->class >> 8;
if (class == PCI_CLASS_DISPLAY_VGA || if (class == PCI_CLASS_DISPLAY_VGA ||
...@@ -1152,7 +1145,7 @@ check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga) ...@@ -1152,7 +1145,7 @@ check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
static void __init static void __init
do_fixup_p2p_level(struct pci_bus *bus) do_fixup_p2p_level(struct pci_bus *bus)
{ {
struct list_head *ln; struct pci_bus *b;
int i, parent_io; int i, parent_io;
int has_vga = 0; int has_vga = 0;
...@@ -1163,8 +1156,7 @@ do_fixup_p2p_level(struct pci_bus *bus) ...@@ -1163,8 +1156,7 @@ do_fixup_p2p_level(struct pci_bus *bus)
if (parent_io >= 4) if (parent_io >= 4)
return; return;
for (ln=bus->children.next; ln != &bus->children; ln=ln->next) { list_for_each_entry(b, &bus->children, node) {
struct pci_bus *b = pci_bus_b(ln);
struct pci_dev *d = b->self; struct pci_dev *d = b->self;
struct pci_controller* hose = (struct pci_controller *)d->sysdata; struct pci_controller* hose = (struct pci_controller *)d->sysdata;
struct resource *res = b->resource[0]; struct resource *res = b->resource[0];
...@@ -1237,12 +1229,10 @@ do_fixup_p2p_level(struct pci_bus *bus) ...@@ -1237,12 +1229,10 @@ do_fixup_p2p_level(struct pci_bus *bus)
static void static void
pcibios_fixup_p2p_bridges(void) pcibios_fixup_p2p_bridges(void)
{ {
struct list_head *ln; struct pci_bus *b;
for(ln=pci_root_buses.next; ln != &pci_root_buses; ln=ln->next) { list_for_each_entry(b, &pci_root_buses, node)
struct pci_bus *b = pci_bus_b(ln);
do_fixup_p2p_level(b); do_fixup_p2p_level(b);
}
} }
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment