From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Bamvor Jian Zhang <bamv2005@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
kernel <kernel@axis.com>, devicetree <devicetree@vger.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] gpio: mockup: Allow probing from device tree
Date: Thu, 29 Oct 2020 08:54:28 +0100 [thread overview]
Message-ID: <20201029075427.t2hwvusjqx27pf6l@axis.com> (raw)
In-Reply-To: <CAHp75Vff1AyKDb=JiocsAefnft+tcm+BnuWDrxViQqZAQZjuVg@mail.gmail.com>
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@bgdev.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.
next prev parent reply other threads:[~2020-10-29 7:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 13:53 Vincent Whitchurch
2020-10-27 18:12 ` Bartosz Golaszewski
2020-10-28 8:57 ` Vincent Whitchurch
2020-10-28 20:25 ` Andy Shevchenko
2020-10-28 20:26 ` Andy Shevchenko
2020-10-29 7:54 ` Vincent Whitchurch [this message]
2020-10-29 9:30 ` Bartosz Golaszewski
2020-10-28 11:43 ` Andy Shevchenko
2020-10-28 11:52 ` Vincent Whitchurch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201029075427.t2hwvusjqx27pf6l@axis.com \
--to=vincent.whitchurch@axis.com \
--cc=andy.shevchenko@gmail.com \
--cc=bamv2005@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=kernel@axis.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®