diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2011-12-16 07:31:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-19 16:13:36 -0500 |
commit | bc12d289e10afe0205738af30883853ed0ab6883 (patch) | |
tree | f4019b7d998226aa000945dfbc8ae185ac1f7f53 /drivers/net/ethernet/sun | |
parent | 0a955c3a6f44927b81ae3bc91b0448eb104d8316 (diff) |
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: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun')
-rw-r--r-- | drivers/net/ethernet/sun/sunhme.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index eebd52f10365..09c518655db2 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c | |||
@@ -2850,7 +2850,7 @@ err_out: | |||
2850 | static int is_quattro_p(struct pci_dev *pdev) | 2850 | static int is_quattro_p(struct pci_dev *pdev) |
2851 | { | 2851 | { |
2852 | struct pci_dev *busdev = pdev->bus->self; | 2852 | struct pci_dev *busdev = pdev->bus->self; |
2853 | struct list_head *tmp; | 2853 | struct pci_dev *this_pdev; |
2854 | int n_hmes; | 2854 | int n_hmes; |
2855 | 2855 | ||
2856 | if (busdev == NULL || | 2856 | if (busdev == NULL || |
@@ -2859,15 +2859,10 @@ static int is_quattro_p(struct pci_dev *pdev) | |||
2859 | return 0; | 2859 | return 0; |
2860 | 2860 | ||
2861 | n_hmes = 0; | 2861 | n_hmes = 0; |
2862 | tmp = pdev->bus->devices.next; | 2862 | list_for_each_entry(this_pdev, &pdev->bus->devices, bus_list) { |
2863 | while (tmp != &pdev->bus->devices) { | ||
2864 | struct pci_dev *this_pdev = pci_dev_b(tmp); | ||
2865 | |||
2866 | if (this_pdev->vendor == PCI_VENDOR_ID_SUN && | 2863 | if (this_pdev->vendor == PCI_VENDOR_ID_SUN && |
2867 | this_pdev->device == PCI_DEVICE_ID_SUN_HAPPYMEAL) | 2864 | this_pdev->device == PCI_DEVICE_ID_SUN_HAPPYMEAL) |
2868 | n_hmes++; | 2865 | n_hmes++; |
2869 | |||
2870 | tmp = tmp->next; | ||
2871 | } | 2866 | } |
2872 | 2867 | ||
2873 | if (n_hmes != 4) | 2868 | if (n_hmes != 4) |