]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 30 Oct 2023 11:50:53 +0000 (13:50 +0200)
committerDominik Brodowski <linux@dominikbrodowski.net>
Mon, 30 Mar 2026 05:28:13 +0000 (07:28 +0200)
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>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/rsrc_nonstatic.c
drivers/pcmcia/yenta_socket.c

index b28d754ba414f8aad50e389d57c4942ae85c5c95..db70028085bca9e2d30c98ab6c0f55f33cfcd4ad 100644 (file)
@@ -935,7 +935,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;
@@ -962,10 +962,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;
index 54dc1fee57aa5c7e0f4a7286b1a9101f6466de47..08c22257b0851ae52ce33621cbb16edf691474e7 100644 (file)
@@ -674,9 +674,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;