ia64/linux-2.6.18-xen.hg

changeset 860:3a8677ef8fd0

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>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 14 11:16:26 2009 +0100 (2009-04-14)
parents 35b981251e10
children 366c31f3ab4b
files drivers/pci/setup-res.c
line diff
     1.1 --- a/drivers/pci/setup-res.c	Tue Apr 14 11:16:08 2009 +0100
     1.2 +++ b/drivers/pci/setup-res.c	Tue Apr 14 11:16:26 2009 +0100
     1.3 @@ -246,8 +246,9 @@ pdev_sort_resources(struct pci_dev *dev,
     1.4  			continue;
     1.5  		
     1.6  		if (i < PCI_BRIDGE_RESOURCES && (r->flags & IORESOURCE_MEM) &&
     1.7 -		    reassigndev)
     1.8 -			r_align = ALIGN(r_align, PAGE_SIZE);
     1.9 +		    !r_align && reassigndev)
    1.10 +			/* -1 is compensation for +1 in the following calc. */
    1.11 +			r_align = ALIGN(r_align, PAGE_SIZE) - 1;
    1.12  
    1.13  		if (!r_align) {
    1.14  			printk(KERN_WARNING "PCI: Ignore bogus resource %d "