From 8f71486db7ed5d4394c5ae573c05680034b7448c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 14 Apr 2009 11:16:26 +0100 Subject: [PATCH] linux/pci/reassign: fix alignment calculation Later r_align is incremented, so it must be decremented as compensation. Signed-off-by: Isaku Yamahata --- drivers/pci/setup-res.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 61bc32c5..8e46cab2 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -246,8 +246,9 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) continue; if (i < PCI_BRIDGE_RESOURCES && (r->flags & IORESOURCE_MEM) && - reassigndev) - r_align = ALIGN(r_align, PAGE_SIZE); + !r_align && reassigndev) + /* -1 is compensation for +1 in the following calc. */ + r_align = ALIGN(r_align, PAGE_SIZE) - 1; if (!r_align) { printk(KERN_WARNING "PCI: Ignore bogus resource %d " -- 2.39.5