ia64/linux-2.6.18-xen.hg

changeset 817:9b150690cb22

Backport: PCI: remove unnecessary condition check in pci_restore_bars()

commit bc5f5a8277cb353161454b6704b3186ebcf3a2a3
Author: Yu Zhao <yu.zhao@intel.com>
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@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Mar 13 08:50:44 2009 +0000 (2009-03-13)
parents f77ac4979fae
children 13a42de2f9c5
files drivers/pci/pci.c
line diff
     1.1 --- a/drivers/pci/pci.c	Fri Mar 13 08:50:15 2009 +0000
     1.2 +++ b/drivers/pci/pci.c	Fri Mar 13 08:50:44 2009 +0000
     1.3 @@ -256,25 +256,10 @@ pci_find_parent_resource(const struct pc
     1.4  void
     1.5  pci_restore_bars(struct pci_dev *dev)
     1.6  {
     1.7 -	int i, numres;
     1.8 +	int i;
     1.9  
    1.10 -	switch (dev->hdr_type) {
    1.11 -	case PCI_HEADER_TYPE_NORMAL:
    1.12 -		numres = 6;
    1.13 -		break;
    1.14 -	case PCI_HEADER_TYPE_BRIDGE:
    1.15 -		numres = 2;
    1.16 -		break;
    1.17 -	case PCI_HEADER_TYPE_CARDBUS:
    1.18 -		numres = 1;
    1.19 -		break;
    1.20 -	default:
    1.21 -		/* Should never get here, but just in case... */
    1.22 -		return;
    1.23 -	}
    1.24 -
    1.25 -	for (i = 0; i < numres; i++)
    1.26 -		pci_update_resource(dev, &dev->resource[i]);
    1.27 +	for (i = 0; i < PCI_BRIDGE_RESOURCES; i++)
    1.28 +		pci_update_resource(dev, i);
    1.29  }
    1.30  
    1.31  int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t t);