Skip to content

Commit bfcde62

Browse files
andy-shevDominik Brodowski
authored andcommitted
pcmcia: Convert to use less arguments in pci_bus_for_each_resource()
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>
1 parent bfeaa68 commit bfcde62

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/pcmcia/rsrc_nonstatic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
935935
static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
936936
{
937937
struct resource *res;
938-
int i, done = 0;
938+
int done = 0;
939939

940940
if (!s->cb_dev || !s->cb_dev->bus)
941941
return -ENODEV;
@@ -962,10 +962,10 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
962962
if (s->cb_dev->bus->number == 0)
963963
return -EINVAL;
964964

965-
for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
965+
for (unsigned int i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
966966
res = s->cb_dev->bus->resource[i];
967967
#else
968-
pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
968+
pci_bus_for_each_resource(s->cb_dev->bus, res) {
969969
#endif
970970
if (!res)
971971
continue;

drivers/pcmcia/yenta_socket.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
674674
u32 min)
675675
{
676676
struct resource *root;
677-
int i;
678677

679-
pci_bus_for_each_resource(socket->dev->bus, root, i) {
678+
pci_bus_for_each_resource(socket->dev->bus, root) {
680679
if (!root)
681680
continue;
682681

0 commit comments

Comments
 (0)