From: Bjorn Helgaas <helgaas@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Pratyush Anand <pratyush.anand@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
PCI <linux-pci@vger.kernel.org>
Subject: Re: of_match[] warnings
Date: Thu, 1 Oct 2020 10:53:10 -0500 [thread overview]
Message-ID: <20201001155310.GA2691450@bjorn-Precision-5520> (raw)
In-Reply-To: <CAL_JsqKhP+o_Y6t8HRRp20F3isAtqdNLPzhg7VxDyY7j-UYOSA@mail.gmail.com>
On Thu, Oct 01, 2020 at 07:48:23AM -0500, Rob Herring wrote:
> On Wed, Sep 30, 2020 at 5:37 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > These warnings are sort of annoying. I guess most of the other
> > drivers avoid this by depending on OF as well as COMPILE_TEST.
>
> Using the of_match_ptr() macro should prevent this.
Both drivers *do* use of_match_ptr(), but the of_device_id table is
unused when of_match_ptr() throws away the pointer.
I guess we could add __maybe_unused to squelch the warning. Ugly, but
I do think COMPILE_TEST has some value.
> > $ grep -E "CONFIG_(OF|PCIE_(SPEAR13XX|ARMADA_8K))" .config
> > CONFIG_PCIE_SPEAR13XX=y
> > CONFIG_PCIE_ARMADA_8K=y
> > # CONFIG_OF is not set
> >
> > $ make W=1 drivers/pci/
> > ...
> > CC drivers/pci/controller/dwc/pcie-spear13xx.o
> > drivers/pci/controller/dwc/pcie-spear13xx.c:270:34: warning: ‘spear13xx_pcie_of_match’ defined but not used [-Wunused-const-variable=]
> > 270 | static const struct of_device_id spear13xx_pcie_of_match[] = {
> > | ^~~~~~~~~~~~~~~~~~~~~~~
> > ...
> > CC drivers/pci/controller/dwc/pcie-armada8k.o
> > drivers/pci/controller/dwc/pcie-armada8k.c:344:34: warning: ‘armada8k_pcie_of_match’ defined but not used [-Wunused-const-variable=]
> > 344 | static const struct of_device_id armada8k_pcie_of_match[] = {
> > | ^~~~~~~~~~~~~~~~~~~~~~
> >
next prev parent reply other threads:[~2020-10-01 15:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 22:37 of_match[] warnings Bjorn Helgaas
2020-10-01 12:48 ` Rob Herring
2020-10-01 15:53 ` Bjorn Helgaas [this message]
2020-10-01 16:43 ` Rob Herring
2020-10-01 16:50 ` Bjorn Helgaas
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=20201001155310.GA2691450@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=pratyush.anand@gmail.com \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/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;
as well as URLs for NNTP newsgroup(s).