Re: [PATCH v1 1/3] gpiolib: Split out for_each_gpio_desc() macro
From: Andy Shevchenko
Date: Tue Apr 05 2022 - 17:04:26 EST
On Tue, Apr 05, 2022 at 02:21:42PM +0200, Bartosz Golaszewski wrote:
> On Wed, Mar 30, 2022 at 4:59 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
...
> > -#define for_each_gpio_desc_with_flag(i, gc, desc, flag) \
> > +#define for_each_gpio_desc(i, gc, desc) \
>
> While at it: how about declaring the i variable in the loop definition?
It will require changes in the users, so, I will do it as a prerequisite
separate change.
> > for (i = 0, desc = gpiochip_get_desc(gc, i); \
> > i < gc->ngpio; \
> > - i++, desc = gpiochip_get_desc(gc, i)) \
> > + i++, desc = gpiochip_get_desc(gc, i))
--
With Best Regards,
Andy Shevchenko