[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201029075427.t2hwvusjqx27pf6l@axis.com>
Date: Thu, 29 Oct 2020 08:54:28 +0100
From: Vincent Whitchurch <vincent.whitchurch@...s.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: Bartosz Golaszewski <brgl@...ev.pl>,
Bamvor Jian Zhang <bamv2005@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
kernel <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 09:25:32PM +0100, Andy Shevchenko 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
> > > +#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.
Yes, you're right. I actually tested a !OF build before but it turns
out that the warning is disabled by default and only enabled with W=1.
I'll fix this and change the header in the next version. Thank you.
Powered by blists - more mailing lists