From: Yu Zhao Date: Fri, 21 Nov 2008 18:40:00 +0000 (+0800) Subject: PCI: remove unnecessary condition check in pci_restore_bars() X-Git-Tag: v2.6.29-rc1~181^2~45 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=bc5f5a8277cb353161454b6704b3186ebcf3a2a3;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c3ef2e78fc5..deeab19d7d1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -376,24 +376,9 @@ pci_find_parent_resource(const struct pci_dev *dev, struct resource *res) static 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; - } + int i; - for (i = 0; i < numres; i++) + for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) pci_update_resource(dev, i); }