[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] Backport: PCI: remove unnecessary condition check in pci_restore_bars()
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1236934244 0 # Node ID 9b150690cb22eeb0504d00a884314f288088aeae # Parent f77ac4979fae40185d00543d99f789d84c9d1f41 Backport: PCI: remove unnecessary condition check in pci_restore_bars() commit bc5f5a8277cb353161454b6704b3186ebcf3a2a3 Author: Yu Zhao <yu.zhao@xxxxxxxxx> Date: Sat Nov 22 02:40:00 2008 +0800 PCI: remove unnecessary condition check in pci_restore_bars() Remove the unnecessary number of resources condition checks because the pci_update_resource() will check availability of the resources. Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx> Signed-off-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx> --- drivers/pci/pci.c | 23 ++++------------------- 1 files changed, 4 insertions(+), 19 deletions(-) diff -r f77ac4979fae -r 9b150690cb22 drivers/pci/pci.c --- a/drivers/pci/pci.c Fri Mar 13 08:50:15 2009 +0000 +++ b/drivers/pci/pci.c Fri Mar 13 08:50:44 2009 +0000 @@ -256,25 +256,10 @@ void void pci_restore_bars(struct pci_dev *dev) { - int i, numres; - - switch (dev->hdr_type) { - case PCI_HEADER_TYPE_NORMAL: - numres = 6; - break; - case PCI_HEADER_TYPE_BRIDGE: - numres = 2; - break; - case PCI_HEADER_TYPE_CARDBUS: - numres = 1; - break; - default: - /* Should never get here, but just in case... */ - return; - } - - for (i = 0; i < numres; i++) - pci_update_resource(dev, &dev->resource[i]); + int i; + + for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) + pci_update_resource(dev, i); } int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t t); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |