lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 May 2021 11:15:31 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Johan Hovold <johan@...nel.org>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Kent Gibson <warthog618@...il.com>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v2 1/1] gpiolib: Introduce for_each_gpio_desc_if() macro

On Thu, May 20, 2021 at 11:07 AM Johan Hovold <johan@...nel.org> wrote:
> On Tue, May 18, 2021 at 11:33:39AM +0300, Andy Shevchenko wrote:

Thank you for the response, my answer below.

...

> The _if suffix here is too vague.
>
> Please use a more descriptive name so that you don't need to look at the
> implementation to understand what the macro does.
>
> Perhaps call it
>
>         for_each_gpio_desc_with_flag()

Haha, I have the same in my internal tree, but then I have changed to
_if and here is why:
- the API is solely for internal use (note, internals of struct
gpio_desc available for the same set of users)
- the current users do only same pattern
- I don't expect that we will have this to be anything else in the future

Thus, _if is a good balance between scope of use and naming.

I prefer to leave it as is.

> or just add the more generic macro
>
>         for_each_gpio_desc()
>
> and open-code the test so that it's clear what's going on here.



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ