[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vepv3YOpPusPM98vxL38rqE0u-ixniKuziRxBjJKT67SA@mail.gmail.com>
Date: Thu, 9 Nov 2023 15:59:09 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Peter Rosin <peda@...ntia.se>, Arnd Bergmann <arnd@...db.de>
Cc: Philip Li <philip.li@...el.com>, kernel test robot <lkp@...el.com>,
Chris Packham <chris.packham@...iedtelesis.co.nz>,
oe-kbuild-all@...ts.linux.dev,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Mark Brown <broonie@...nel.org>
Subject: Re: drivers/mux/adg792a.c:134:34: warning: 'adg792a_of_match' defined
but not used
On Tue, Nov 7, 2023 at 11:39 PM Peter Rosin <peda@...ntia.se> wrote:
> 2023-11-07 at 20:59, Andy Shevchenko wrote:
> > On Mon, Nov 6, 2023 at 11:31 PM Peter Rosin <peda@...ntia.se> wrote:
...
> > The use of the of_match_ptr() is quite doubtful, no?
>
> I was trying to answer why the spi-mux addition was (wrongly) fingered as
> the first bad commit. I should have been clearer...
>
> I don't see what's wrong with using of_match_ptr() in this driver as
> CONFIG_OF is not required here. Why isn't the correct fix to instead
> put the definition of adg792a_of_match in an #ifdef CONFIG_OF block?
Because:
- it is prone to error (as evidence this report)
- it adds ugly ifdeffery and more LoCs in the code for no value
- it prevents driver to be used in ACPI
I found at least two of these arguments are serious enough to drop
that macro and not use it _at all_ generally speaking.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists