Re: of_match[] warnings

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

 



On Thu, Oct 1, 2020 at 10:53 AM Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote:
>
> 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@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.
>
> Both drivers *do* use of_match_ptr(), but the of_device_id table is
> unused when of_match_ptr() throws away the pointer.

Oh right, it's actually we don't want to use of_match_ptr() in this case.

> I guess we could add __maybe_unused to squelch the warning.  Ugly, but
> I do think COMPILE_TEST has some value.

We do that or an ifdef for drivers that actually work for !OF.

We also have lot's of 'depends on OF' as proposed too, but that's not
really my preference given we have empty functions for most
everything.

Rob



[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