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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 21 Jan 2021 10:29:54 -0800
From:   Saravana Kannan <saravanak@...gle.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-tegra <linux-tegra@...r.kernel.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Jon Hunter <jonathanh@...dia.com>,
        Marc Zyngier <maz@...nel.org>,
        Kevin Hilman <khilman@...libre.com>,
        Android Kernel Team <kernel-team@...roid.com>
Subject: Re: [PATCH v1 1/2] of: property: Add fw_devlink support for "gpio"
 and "gpios" binding

On Thu, Jan 21, 2021 at 5:11 AM Linus Walleij <linus.walleij@...aro.org> wrote:
>
> On Wed, Jan 20, 2021 at 9:05 AM Saravana Kannan <saravanak@...gle.com> wrote:
>
> > To provide backward compatibility for boards that use deprecated DT
> > bindings, we need to add fw_devlink support for "gpio" and "gpios".
>
> You do some more stuff in the patch so describe that too.
> Especially the check for hogs and #gpio-cells.
> Describe why you do that. Maybe even with a comment in
> the code because I don't think everyone will understand.

Ack

>
> > +       if (strcmp(prop_name, "gpio") && strcmp(prop_name, "gpios"))
> > +               return NULL;
>
> This part is easy to understand.
>
> > +       if (of_find_property(np, "gpio-hog", NULL))
> > +               return NULL;
> > +
> > +       if (of_parse_phandle_with_args(np, prop_name, "#gpio-cells", index,
> > +                                      &sup_args))
> > +               return NULL;
>
> This part is hard to understand. Insert comments and tell the reader
> of the code what is going on and why.

I assume the "hard to understand" part is the gpio-hog part? Because
the last line is pretty straightforward -- it's returning the index-th
phandle. Also, it's a copy-paste from the DEFINE_SIMPLE_PROP macro.


-Saravana

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ