]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: Correct PCI_STD_RESOURCE_END usage
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 19 May 2017 19:40:50 +0000 (14:40 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 13 Jun 2017 16:44:23 +0000 (11:44 -0500)
PCI_STD_RESOURCE_END is (confusingly) the index of the last valid BAR, not
the *number* of BARs.  To iterate through all possible BARs, we need to
include PCI_STD_RESOURCE_END.

Fixes: 9fe373f9997b ("PCI: Increase IBM ipr SAS Crocodile BARs to at least system page size")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/quirks.c

index 085fb787aa9e03b88b505ec9365ecd7a275a3f79..16e6cd86ad71afe7ab7ca0280a0393d6ab616784 100644 (file)
@@ -304,7 +304,7 @@ static void quirk_extend_bar_to_page(struct pci_dev *dev)
 {
        int i;
 
-       for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+       for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
                struct resource *r = &dev->resource[i];
 
                if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) {