| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [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@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |