ia64/linux-2.6.18-xen.hg

diff drivers/pci/setup-res.c @ 701:16c549b3ba59

xen: conditionalize PCI reassign code by a config option, selected
only from privileged Xen configurations.

Also eliminate the pointless new macro ROUND_UP_TO_PAGESIZE().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Oct 14 14:58:08 2008 +0100 (2008-10-14)
parents 2b5cc22ab406
children 8fbf8e2fd087
line diff
     1.1 --- a/drivers/pci/setup-res.c	Tue Oct 14 14:57:26 2008 +0100
     1.2 +++ b/drivers/pci/setup-res.c	Tue Oct 14 14:58:08 2008 +0100
     1.3 @@ -117,7 +117,8 @@ pci_claim_resource(struct pci_dev *dev, 
     1.4  }
     1.5  EXPORT_SYMBOL_GPL(pci_claim_resource);
     1.6  
     1.7 -void 
     1.8 +#ifdef CONFIG_PCI_REASSIGN
     1.9 +void
    1.10  pci_update_bridge(struct pci_dev *dev, int resno)
    1.11  {
    1.12  	struct resource *res = &dev->resource[resno]; 
    1.13 @@ -184,6 +185,7 @@ pci_update_bridge(struct pci_dev *dev, i
    1.14  		break;
    1.15  	}
    1.16  }
    1.17 +#endif
    1.18  
    1.19  int pci_assign_resource(struct pci_dev *dev, int resno)
    1.20  {
    1.21 @@ -202,7 +204,7 @@ int pci_assign_resource(struct pci_dev *
    1.22  		align = size;
    1.23  		if ((reassigndev) &&
    1.24  		    (res->flags & IORESOURCE_MEM)) {
    1.25 -			align = ROUND_UP_TO_PAGESIZE(align);
    1.26 +			align = ALIGN(align, PAGE_SIZE);
    1.27  		}
    1.28  	} else {
    1.29  		align = res->start;
    1.30 @@ -231,9 +233,11 @@ int pci_assign_resource(struct pci_dev *
    1.31  			resno, (unsigned long long)size,
    1.32  			(unsigned long long)res->start, pci_name(dev));
    1.33  	} else if (resno < PCI_BRIDGE_RESOURCES) {
    1.34 -		printk(KERN_DEBUG "PCI: Assign resource(%d) on %s "
    1.35 -			"%016llx - %016llx\n", resno, pci_name(dev),
    1.36 -			(u64)res->start, (u64)res->end);
    1.37 +		if (reassign_resources && is_reassigndev(dev))
    1.38 +			printk(KERN_DEBUG "PCI: Assign resource(%d) on %s "
    1.39 +				"%016llx - %016llx\n", resno, pci_name(dev),
    1.40 +				 (unsigned long long)res->start,
    1.41 +				 (unsigned long long)res->end);
    1.42  		pci_update_resource(dev, res, resno);
    1.43  	}
    1.44