Commit 4e344b1cc53989e8ecc1140e9346f657d7c8aa9e
Committed by
Jesse Barnes
1 parent
30da552428
Exists in
master
and in
7 other branches
PCI: use for_each_pci_dev()
Use for_each_pci_dev() to simplify the code. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Showing 5 changed files with 6 additions and 7 deletions Side-by-side Diff
drivers/pci/hotplug/fakephp.c
drivers/pci/proc.c
... | ... | @@ -483,9 +483,9 @@ |
483 | 483 | proc_create("devices", 0, proc_bus_pci_dir, |
484 | 484 | &proc_bus_pci_dev_operations); |
485 | 485 | proc_initialized = 1; |
486 | - while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | |
486 | + for_each_pci_dev(dev) | |
487 | 487 | pci_proc_attach_device(dev); |
488 | - } | |
488 | + | |
489 | 489 | return 0; |
490 | 490 | } |
491 | 491 |
drivers/pci/quirks.c
... | ... | @@ -2773,7 +2773,7 @@ |
2773 | 2773 | printk(KERN_DEBUG "PCI: CLS %u bytes\n", |
2774 | 2774 | pci_cache_line_size << 2); |
2775 | 2775 | |
2776 | - while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | |
2776 | + for_each_pci_dev(dev) { | |
2777 | 2777 | pci_fixup_device(pci_fixup_final, dev); |
2778 | 2778 | /* |
2779 | 2779 | * If arch hasn't set it explicitly yet, use the CLS |
drivers/pci/search.c
... | ... | @@ -169,7 +169,7 @@ |
169 | 169 | { |
170 | 170 | struct pci_dev *dev = NULL; |
171 | 171 | |
172 | - while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | |
172 | + for_each_pci_dev(dev) { | |
173 | 173 | if (pci_domain_nr(dev->bus) == domain && |
174 | 174 | (dev->bus->number == bus && dev->devfn == devfn)) |
175 | 175 | return dev; |
drivers/pci/setup-irq.c