* [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
@ 2023-10-30 11:50 Andy Shevchenko
2024-02-01 15:17 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2023-10-30 11:50 UTC (permalink / raw)
To: linux-kernel
Cc: Dominik Brodowski, Andy Shevchenko, Krzysztof Wilczyński
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
2023-10-30 11:50 [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource() Andy Shevchenko
@ 2024-02-01 15:17 ` Andy Shevchenko
2024-02-01 16:19 ` Dominik Brodowski
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-02-01 15:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Dominik Brodowski, Krzysztof Wilczyński
On Mon, Oct 30, 2023 at 01:50:53PM +0200, Andy Shevchenko wrote:
> 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.
Can it be now applied?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
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
0 siblings, 2 replies; 6+ messages in thread
From: Dominik Brodowski @ 2024-02-01 16:19 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-kernel, Krzysztof Wilczyński
Am Thu, Feb 01, 2024 at 05:17:11PM +0200 schrieb Andy Shevchenko:
> On Mon, Oct 30, 2023 at 01:50:53PM +0200, Andy Shevchenko wrote:
> > 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.
>
> Can it be now applied?
Which tree will this go through? No need to involve the PCMCIA tree, and you
already have my ACK...
Best,
Dominik
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
2024-02-01 16:19 ` Dominik Brodowski
@ 2024-02-01 16:22 ` Andy Shevchenko
2026-01-13 9:00 ` Andy Shevchenko
1 sibling, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-02-01 16:22 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: linux-kernel, Krzysztof Wilczyński
On Thu, Feb 01, 2024 at 05:19:17PM +0100, Dominik Brodowski wrote:
> Am Thu, Feb 01, 2024 at 05:17:11PM +0200 schrieb Andy Shevchenko:
> > On Mon, Oct 30, 2023 at 01:50:53PM +0200, Andy Shevchenko wrote:
> > > 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.
> >
> > Can it be now applied?
>
> Which tree will this go through? No need to involve the PCMCIA tree, and you
> already have my ACK...
I believe PCI one, okay, seems like I have to resend with Bjorn being included.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
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
1 sibling, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2026-01-13 9:00 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: linux-kernel, Krzysztof Wilczyński
On Thu, Feb 01, 2024 at 05:19:17PM +0100, Dominik Brodowski wrote:
> Am Thu, Feb 01, 2024 at 05:17:11PM +0200 schrieb Andy Shevchenko:
> > On Mon, Oct 30, 2023 at 01:50:53PM +0200, Andy Shevchenko wrote:
> > > 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.
> >
> > Can it be now applied?
>
> Which tree will this go through? No need to involve the PCMCIA tree, and you
> already have my ACK...
Still not being applied. Can you pull it via your tree, please?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
2026-01-13 9:00 ` Andy Shevchenko
@ 2026-03-30 5:45 ` Dominik Brodowski
0 siblings, 0 replies; 6+ messages in thread
From: Dominik Brodowski @ 2026-03-30 5:45 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-kernel, Krzysztof Wilczyński
Am Tue, Jan 13, 2026 at 11:00:11AM +0200 schrieb Andy Shevchenko:
> On Thu, Feb 01, 2024 at 05:19:17PM +0100, Dominik Brodowski wrote:
> > Am Thu, Feb 01, 2024 at 05:17:11PM +0200 schrieb Andy Shevchenko:
> > > On Mon, Oct 30, 2023 at 01:50:53PM +0200, Andy Shevchenko wrote:
> > > > 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.
> > >
> > > Can it be now applied?
> >
> > Which tree will this go through? No need to involve the PCMCIA tree, and you
> > already have my ACK...
>
> Still not being applied. Can you pull it via your tree, please?
Applied. Thanks,
Dominik
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-30 5:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30 11:50 [PATCH v1 1/1] pcmcia: Convert to use less arguments in pci_bus_for_each_resource() Andy Shevchenko
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox