PCI: Consolidate calls to pcibios_bus_to_resource() in __pci_read_base()
authorKevin Hao <haokexin@gmail.com>
Sat, 25 May 2013 11:36:26 +0000 (19:36 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 25 May 2013 18:01:24 +0000 (12:01 -0600)
Since we will invoke pcibios_bus_to_resource() unconditionally if we
don't goto fail, move it out of if/else wrap.  No function change.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c

index d40cd05..cd7b6de 100644 (file)
@@ -250,12 +250,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
                        pci_write_config_dword(dev, pos + 4, 0);
                        region.start = 0;
                        region.end = sz64;
-                       pcibios_bus_to_resource(dev, res, &region);
                        bar_disabled = true;
                } else {
                        region.start = l64;
                        region.end = l64 + sz64;
-                       pcibios_bus_to_resource(dev, res, &region);
                }
        } else {
                sz = pci_size(l, sz, mask);
@@ -265,9 +263,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
 
                region.start = l;
                region.end = l + sz;
-               pcibios_bus_to_resource(dev, res, &region);
        }
 
+       pcibios_bus_to_resource(dev, res, &region);
+
        goto out;