Commit bf684f65 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by David S. Miller

de4x5/PCI: use list_for_each_entry() for bus->devices traversal

Replace open-coded list traversal with list_for_each_entry().

CC: Grant Grundler <grundler@parisc-linux.org>
CC: netdev@vger.kernel.org
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc12d289
...@@ -2127,14 +2127,9 @@ srom_search(struct net_device *dev, struct pci_dev *pdev) ...@@ -2127,14 +2127,9 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
u_long iobase = 0; /* Clear upper 32 bits in Alphas */ u_long iobase = 0; /* Clear upper 32 bits in Alphas */
int i, j; int i, j;
struct de4x5_private *lp = netdev_priv(dev); struct de4x5_private *lp = netdev_priv(dev);
struct list_head *walk; struct pci_dev *this_dev;
list_for_each(walk, &pdev->bus_list) {
struct pci_dev *this_dev = pci_dev_b(walk);
/* Skip the pci_bus list entry */
if (list_entry(walk, struct pci_bus, devices) == pdev->bus) continue;
list_for_each_entry(this_dev, &pdev->bus->devices, bus_list) {
vendor = this_dev->vendor; vendor = this_dev->vendor;
device = this_dev->device << 8; device = this_dev->device << 8;
if (!(is_DC21040 || is_DC21041 || is_DC21140 || is_DC2114x)) continue; if (!(is_DC21040 || is_DC21041 || is_DC21140 || is_DC2114x)) continue;
......
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