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

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

Replace open-coded list traversal with list_for_each_entry().

CC: David S. Miller <davem@davemloft.net>
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 0a955c3a
...@@ -2850,7 +2850,7 @@ static int __devinit happy_meal_sbus_probe_one(struct platform_device *op, int i ...@@ -2850,7 +2850,7 @@ static int __devinit happy_meal_sbus_probe_one(struct platform_device *op, int i
static int is_quattro_p(struct pci_dev *pdev) static int is_quattro_p(struct pci_dev *pdev)
{ {
struct pci_dev *busdev = pdev->bus->self; struct pci_dev *busdev = pdev->bus->self;
struct list_head *tmp; struct pci_dev *this_pdev;
int n_hmes; int n_hmes;
if (busdev == NULL || if (busdev == NULL ||
...@@ -2859,15 +2859,10 @@ static int is_quattro_p(struct pci_dev *pdev) ...@@ -2859,15 +2859,10 @@ static int is_quattro_p(struct pci_dev *pdev)
return 0; return 0;
n_hmes = 0; n_hmes = 0;
tmp = pdev->bus->devices.next; list_for_each_entry(this_pdev, &pdev->bus->devices, bus_list) {
while (tmp != &pdev->bus->devices) {
struct pci_dev *this_pdev = pci_dev_b(tmp);
if (this_pdev->vendor == PCI_VENDOR_ID_SUN && if (this_pdev->vendor == PCI_VENDOR_ID_SUN &&
this_pdev->device == PCI_DEVICE_ID_SUN_HAPPYMEAL) this_pdev->device == PCI_DEVICE_ID_SUN_HAPPYMEAL)
n_hmes++; n_hmes++;
tmp = tmp->next;
} }
if (n_hmes != 4) if (n_hmes != 4)
......
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