[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] linux/pci/reassign: fix alignment calculation



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1239704186 -3600
# Node ID 3a8677ef8fd0e7fbdbd79ef6924fe87deb5b8710
# Parent  35b981251e102e114f2a0731a03e697d5a16b8d1
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>
---
 drivers/pci/setup-res.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r 35b981251e10 -r 3a8677ef8fd0 drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c   Tue Apr 14 11:16:08 2009 +0100
+++ b/drivers/pci/setup-res.c   Tue Apr 14 11:16:26 2009 +0100
@@ -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 "

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.