ia64/linux-2.6.18-xen.hg

changeset 862:dfd2adc58740

pci: clean up of changeset 860

The fixing logic was somewhat confused and doesn't produce right
result. This patch cleans it up.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 16 11:47:44 2009 +0100 (2009-04-16)
parents 366c31f3ab4b
children 464a925d73f1
files drivers/pci/setup-res.c
line diff
     1.1 --- a/drivers/pci/setup-res.c	Tue Apr 14 11:17:47 2009 +0100
     1.2 +++ b/drivers/pci/setup-res.c	Thu Apr 16 11:47:44 2009 +0100
     1.3 @@ -245,11 +245,6 @@ pdev_sort_resources(struct pci_dev *dev,
     1.4  		if (!(r->flags) || r->parent)
     1.5  			continue;
     1.6  		
     1.7 -		if (i < PCI_BRIDGE_RESOURCES && (r->flags & IORESOURCE_MEM) &&
     1.8 -		    !r_align && reassigndev)
     1.9 -			/* -1 is compensation for +1 in the following calc. */
    1.10 -			r_align = ALIGN(r_align, PAGE_SIZE) - 1;
    1.11 -
    1.12  		if (!r_align) {
    1.13  			printk(KERN_WARNING "PCI: Ignore bogus resource %d "
    1.14  				"[%llx:%llx] of %s\n",
    1.15 @@ -258,6 +253,11 @@ pdev_sort_resources(struct pci_dev *dev,
    1.16  			continue;
    1.17  		}
    1.18  		r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
    1.19 +
    1.20 +		if (i < PCI_BRIDGE_RESOURCES && (r->flags & IORESOURCE_MEM) &&
    1.21 +		    reassigndev)
    1.22 +			r_align = ALIGN(r_align, PAGE_SIZE);
    1.23 +
    1.24  		for (list = head; ; list = list->next) {
    1.25  			resource_size_t align = 0;
    1.26  			struct resource_list *ln = list->next;