]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux/pci/reassign: fix alignment calculation
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 14 Apr 2009 10:16:26 +0000 (11:16 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 14 Apr 2009 10:16:26 +0000 (11:16 +0100)
Later r_align is incremented, so it must be decremented
as compensation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
drivers/pci/setup-res.c

index 61bc32c56e4c497b0bc91e3a755bdb3b51bfffe0..8e46cab2291f595bf1e2cd52b1a1eae3dc8f7cb2 100644 (file)
@@ -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 "