Re: of_match[] warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 30, 2020 at 5:37 PM Bjorn Helgaas <helgaas@xxxxxxxxxx> 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.

>   $ 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[] = {
>         |                                  ^~~~~~~~~~~~~~~~~~~~~~
>




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux