summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-05-19 21:40:50 +0200
committerBjorn Helgaas <bhelgaas@google.com>2017-06-13 18:44:23 +0200
commit2f686f1d9beee135de6d08caea707ec7bfc916d4 (patch)
tree90669c57fe05c9d758b1b0184b69a739b915d988 /drivers/pci
parentefi/fb: Correct PCI_STD_RESOURCE_END usage (diff)
downloadlinux-2f686f1d9beee135de6d08caea707ec7bfc916d4.tar.xz
linux-2f686f1d9beee135de6d08caea707ec7bfc916d4.zip
PCI: Correct PCI_STD_RESOURCE_END usage
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/quirks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 085fb787aa9e..16e6cd86ad71 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -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) {