From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: "Dominik Brodowski" <linux@dominikbrodowski.net>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Krzysztof Wilczyński" <kw@linux.com>
Subject: [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
Date: Mon, 30 Oct 2023 13:50:53 +0200 [thread overview]
Message-ID: <20231030115053.2752588-1-andriy.shevchenko@linux.intel.com> (raw)
The pci_bus_for_each_resource() can hide the iterator loop since
it may be not used otherwise. With this, we may drop that iterator
variable definition.
Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Split out of a series: 20230330162434.35055-1-andriy.shevchenko@linux.intel.com.
Fixed the second hunk in nonstatic_autoadd_resources() to avoid
potential breakage.
drivers/pcmcia/rsrc_nonstatic.c | 6 +++---
drivers/pcmcia/yenta_socket.c | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index bf9d070a4496..39da2ad9d0b2 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;
@@ -961,10 +961,10 @@ 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++) {
+ for (unsigned int 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) {
+ pci_bus_for_each_resource(s->cb_dev->bus, res) {
#endif
if (!res)
continue;
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 1365eaa20ff4..fd18ab571ce8 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(socket->dev->bus, root) {
if (!root)
continue;
--
2.40.0.1.gaa8946217a0b
next reply other threads:[~2023-10-30 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 11:50 Andy Shevchenko [this message]
2024-02-01 15:17 ` Andy Shevchenko
2024-02-01 16:19 ` Dominik Brodowski
2024-02-01 16:22 ` Andy Shevchenko
2026-01-13 9:00 ` Andy Shevchenko
2026-03-30 5:45 ` Dominik Brodowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231030115053.2752588-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®