WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux/pci/reassign: fix alignment calculation

To: xen-devel@xxxxxxxxxxxxxxxxxxx, shimada-yxb@xxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] linux/pci/reassign: fix alignment calculation
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Fri, 10 Apr 2009 17:57:18 +0900
Cc:
Delivery-date: Fri, 10 Apr 2009 01:58:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/pci/reassign: fix alignment calculation, Isaku Yamahata <=