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]
Message-ID: <yG5ebSToQJ6Oj2Oe8C7JimXFFcPT8LJ8@localhost>
Date:   Mon, 04 Jul 2022 16:31:57 +0100
From:   Aidan MacDonald <aidanmacdonald.0x0@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Michael Walle <michael@...le.cc>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] gpio: regmap: Support combined GPIO and pin control
 drivers


Andy Shevchenko <andy.shevchenko@...il.com> writes:

> On Sun, Jul 3, 2022 at 1:11 PM Aidan MacDonald
> <aidanmacdonald.0x0@...il.com> wrote:
>>
>> Allow gpio-regmap to be used for the GPIO portion of a combined
>> pin control and GPIO driver by setting the has_pinctrl flag. This
>> flag will cause GPIO direction set ops to be implemented as calls
>> to pinctrl_gpio_direction_input/output() instead of updating the
>> direction set registers directly.
>>
>> Note that reg_dir_out/in_base is still required for implementing
>> the GPIO chip's ->get_direction() callback.
>
> ...
>
>> +       /*
>> +        * we need a direction register for implementing ->get_direction
>> +        * even if ->direction_input/output is handled by pin control
>> +        */
>
> /*
>  * Multi-line comments go with this format
>  * or style. Pay attention to the capitalization
>  * and English grammar, e.g. period at the end of sentence(s).
>  */
>

I used this "style" to match the surrounding code, but I suppose
I might as well fix the other comments while I'm here.

>> +       if (config->has_pinctrl && !(config->reg_dir_in_base ||
>> +                                    config->reg_dir_out_base))
>
> Can you re-indent this either to be one line or put the second part of
> the conditional onto the second line?

Yep.

>
> And why not use && everywhere?
>

No reason to be honest, but maybe it's easier to understand?

  "has pin control and doesn't set reg_dir_in_base or reg_dir_out_base".

Using && is more like this:

  "has pin control, doesn't set reg_dir_in_base, and doesn't
  set reg_dir_out_base".

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ