stmmac: pci: use defined constant instead of magic number
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Nov 2014 10:27:26 +0000 (12:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Nov 2014 19:38:57 +0000 (14:38 -0500)
The last standard PCI resource is defined as PCI_STD_RESOURCE_END. Thus, we
could use it instead of plain integer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c

index e17a970eaf2b87a1ff184270835102a85fa5f1f4..e45794de5db96b3af15bd0b0e4ef5e8bac7f8ceb 100644 (file)
@@ -90,7 +90,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
        }
 
        /* Get the base address of device */
-       for (i = 0; i <= 5; i++) {
+       for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
                if (pci_resource_len(pdev, i) == 0)
                        continue;
                addr = pci_iomap(pdev, i, 0);