[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230310171416.23356-5-andriy.shevchenko@linux.intel.com>
Date: Fri, 10 Mar 2023 19:14:16 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Mickaël Salaün <mic@...ikod.net>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Krzysztof Wilczyński <kw@...ux.com>,
Michael Ellerman <mpe@...erman.id.au>,
Randy Dunlap <rdunlap@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
Bjorn Helgaas <helgaas@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Pali Rohár <pali@...nel.org>,
"Maciej W. Rozycki" <macro@...am.me.uk>,
Juergen Gross <jgross@...e.com>,
Dominik Brodowski <linux@...inikbrodowski.net>,
linux-kernel@...r.kernel.org, linux-alpha@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-sh@...r.kernel.org,
sparclinux@...r.kernel.org, linux-pci@...r.kernel.org,
xen-devel@...ts.xenproject.org, linux-acpi@...r.kernel.org
Cc: Miguel Ojeda <ojeda@...nel.org>,
Richard Henderson <richard.henderson@...aro.org>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
Russell King <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Gregory Clement <gregory.clement@...tlin.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Anatolij Gustschin <agust@...x.de>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
"David S. Miller" <davem@...emloft.net>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>
Subject: [PATCH v4 4/4] pcmcia: Convert to use pci_bus_for_each_resource_p()
The pci_bus_for_each_resource_p() hides the iterator loop since
it may be not used otherwise. With this, we may drop that iterator
variable definition.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Reviewed-by: Krzysztof Wilczyński <kw@...ux.com>
Acked-by: Dominik Brodowski <linux@...inikbrodowski.net>
---
drivers/pcmcia/rsrc_nonstatic.c | 9 +++------
drivers/pcmcia/yenta_socket.c | 3 +--
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index ad1141fddb4c..9d92d4bb6239 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -934,7 +934,7 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
{
struct resource *res;
- int i, done = 0;
+ int done = 0;
if (!s->cb_dev || !s->cb_dev->bus)
return -ENODEV;
@@ -960,12 +960,9 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
*/
if (s->cb_dev->bus->number == 0)
return -EINVAL;
-
- for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
- res = s->cb_dev->bus->resource[i];
-#else
- pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
#endif
+
+ pci_bus_for_each_resource_p(s->cb_dev->bus, res) {
if (!res)
continue;
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 1365eaa20ff4..2e5bdf3db0ba 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -673,9 +673,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
u32 min)
{
struct resource *root;
- int i;
- pci_bus_for_each_resource(socket->dev->bus, root, i) {
+ pci_bus_for_each_resource_p(socket->dev->bus, root) {
if (!root)
continue;
--
2.39.1
Powered by blists - more mailing lists