diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-05-28 18:31:26 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-06-25 07:44:24 -0500 |
commit | da6163ad3aae627d0b12ae58300c5d02d8ee613e (patch) | |
tree | e923210ad063aa2c10e1bddb2566e15d0cc4c976 /drivers/pci | |
parent | 2fbb353041891ce8527667ca956d9c53222dec01 (diff) | |
download | linux-da6163ad3aae627d0b12ae58300c5d02d8ee613e.tar.gz linux-da6163ad3aae627d0b12ae58300c5d02d8ee613e.tar.bz2 linux-da6163ad3aae627d0b12ae58300c5d02d8ee613e.zip |
PCI: versatile: Simplify host bridge window iteration
The switch is the only statement in the resource_list_for_each_entry()
loop, so remove unnecessary "continue" statements in the switch. Simplify
checking for the required non-prefetchable memory aperture.
No functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-versatile.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c index 273edaca8f49..f234405770ab 100644 --- a/drivers/pci/host/pci-versatile.c +++ b/drivers/pci/host/pci-versatile.c @@ -90,11 +90,9 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev, switch (resource_type(res)) { case IORESOURCE_IO: err = pci_remap_iospace(res, iobase); - if (err) { + if (err) dev_warn(dev, "error %d: failed to map resource %pR\n", err, res); - continue; - } break; case IORESOURCE_MEM: res_valid |= !(res->flags & IORESOURCE_PREFETCH); @@ -104,19 +102,14 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev, mem++; break; - case IORESOURCE_BUS: - default: - continue; } } - if (!res_valid) { - dev_err(dev, "non-prefetchable memory resource required\n"); - err = -EINVAL; - goto out_release_res; - } + if (res_valid) + return 0; - return 0; + dev_err(dev, "non-prefetchable memory resource required\n"); + err = -EINVAL; out_release_res: pci_free_resource_list(res); |