]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
pci: clean up of changeset 860
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 16 Apr 2009 10:47:44 +0000 (11:47 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 16 Apr 2009 10:47:44 +0000 (11:47 +0100)
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>
drivers/pci/setup-res.c

index 8e46cab2291f595bf1e2cd52b1a1eae3dc8f7cb2..055879aacf350c2bd6213058b0a9ce281abc34af 100644 (file)
@@ -245,11 +245,6 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
                if (!(r->flags) || r->parent)
                        continue;
                
-               if (i < PCI_BRIDGE_RESOURCES && (r->flags & IORESOURCE_MEM) &&
-                   !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 "
                                "[%llx:%llx] of %s\n",
@@ -258,6 +253,11 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
                        continue;
                }
                r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
+
+               if (i < PCI_BRIDGE_RESOURCES && (r->flags & IORESOURCE_MEM) &&
+                   reassigndev)
+                       r_align = ALIGN(r_align, PAGE_SIZE);
+
                for (list = head; ; list = list->next) {
                        resource_size_t align = 0;
                        struct resource_list *ln = list->next;