提交 da6163ad 编写于 作者: B Bjorn Helgaas

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: NBjorn Helgaas <bhelgaas@google.com>
上级 2fbb3530
...@@ -90,11 +90,9 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev, ...@@ -90,11 +90,9 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
switch (resource_type(res)) { switch (resource_type(res)) {
case IORESOURCE_IO: case IORESOURCE_IO:
err = pci_remap_iospace(res, iobase); err = pci_remap_iospace(res, iobase);
if (err) { if (err)
dev_warn(dev, "error %d: failed to map resource %pR\n", dev_warn(dev, "error %d: failed to map resource %pR\n",
err, res); err, res);
continue;
}
break; break;
case IORESOURCE_MEM: case IORESOURCE_MEM:
res_valid |= !(res->flags & IORESOURCE_PREFETCH); res_valid |= !(res->flags & IORESOURCE_PREFETCH);
...@@ -104,19 +102,14 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev, ...@@ -104,19 +102,14 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
mem++; mem++;
break; break;
case IORESOURCE_BUS:
default:
continue;
} }
} }
if (!res_valid) { if (res_valid)
dev_err(dev, "non-prefetchable memory resource required\n"); return 0;
err = -EINVAL;
goto out_release_res;
}
return 0; dev_err(dev, "non-prefetchable memory resource required\n");
err = -EINVAL;
out_release_res: out_release_res:
pci_free_resource_list(res); pci_free_resource_list(res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册