[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 06 Jun 2016 18:07:51 -0500
From: Bjorn Helgaas <bhelgaas@...gle.com>
To: linux-pci@...r.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Rob Herring <robh@...nel.org>,
Jason Cooper <jason@...edaemon.net>,
Scott Branden <sbranden@...adcom.com>,
Jon Mason <jonmason@...adcom.com>,
Jingoo Han <jingoohan1@...il.com>,
Pratyush Anand <pratyush.anand@...il.com>,
linux-kernel@...r.kernel.org, rfi@...ts.rocketboards.org,
linux-renesas-soc@...r.kernel.org,
Simon Horman <horms@...ge.net.au>,
Thierry Reding <thierry.reding@...il.com>,
Tanmay Inamdar <tinamdar@....com>, Ray Jui <rjui@...adcom.com>,
linux-tegra@...r.kernel.org, Ley Foon Tan <lftan@...era.com>,
Michal Simek <michal.simek@...inx.com>,
Sören Brinkmann <soren.brinkmann@...inx.com>,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v1 25/25] 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@...gle.com>
---
drivers/pci/host/pci-versatile.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c
index 273edac..f2344057 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);
Powered by blists - more mailing lists