[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MdDXY4vLSO0+ubanGxO3=wE+MEvcUM96X-0UsS=q1MDbA@mail.gmail.com>
Date: Wed, 12 Feb 2025 14:41:16 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v2 3/3] gpiolib: Switch to use for_each_if() helper
On Fri, Feb 7, 2025 at 4:11 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> The for_each_*() APIs that are conditional can be written shorter and
> less error prone with for_each_if() helper in use. Switch them to use
> this helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> include/linux/gpio/driver.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index ae93f75170f2..a7e9c1d3df71 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -532,6 +532,7 @@ struct gpio_chip {
>
> char *gpiochip_dup_line_label(struct gpio_chip *gc, unsigned int offset);
>
> +#define for_each_if(condition) if (!(condition)) {} else
This is already defined in drm/drm_util.h. Please move it out of there
and make it available globally instead of duplicating.
Bart
Powered by blists - more mailing lists