Isaku Yamahata
2009-Apr-10 08:57 UTC
[Xen-devel] [PATCH] linux/pci/reassign: fix alignment calculation
linux/pci/reassign: fix alignment calculation Later r_align is incremented, so it must be decremented as compensation. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -246,8 +246,9 @@ pdev_sort_resources(struct pci_dev *dev, 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 " -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel