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] [day] [month] [year] [list]
Date:   Thu, 29 Oct 2020 10:30:04 +0100
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Vincent Whitchurch <vincent.whitchurch@...s.com>,
        Bamvor Jian Zhang <bamv2005@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        kernel@...s.com, devicetree <devicetree@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] gpio: mockup: Allow probing from device tree

On Wed, Oct 28, 2020 at 9:24 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Wed, Oct 28, 2020 at 8:41 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
> > On Tue, Oct 27, 2020 at 2:54 PM Vincent Whitchurch
> > <vincent.whitchurch@...s.com> wrote:
>
> ...
>
> > > +#include <linux/of.h>
> >
> > Please keep the includes ordered alphabetically.
>
> Besides the fact that that is a wrong header to be included.
> mod_devicetable.h is the correct one.
> (See also below)
>
> ...
>
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id gpio_mockup_of_match[] = {
> > > +       { .compatible = "gpio-mockup", },
> > > +       {},
> > > +};
> > > +MODULE_DEVICE_TABLE(of, gpio_mockup_of_match);
> > > +#endif
> >
> > You don't need this ifdef - of_match_ptr() will evaluate to NULL if
> > CONFIG_OF is disabled and the compiler will optimize this struct out.
>
> It's not so. If you drop ugly ifdeffery (and I vote for that, see also
> above) the of_match_ptr() must be dropped as well.
> Otherwise the compiler will issue the warning. So it is either all or none.
>
> --
> With Best Regards,
> Andy Shevchenko

Makes sense, I'll remove this from my tree for now then. Vincent:
please send another iteration.

Bartosz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ