lkml.org 
[lkml]   [2023]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: 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@axentia.se> wrote:
> 2023-11-07 at 20:59, Andy Shevchenko wrote:
> > On Mon, Nov 6, 2023 at 11:31 PM Peter Rosin <peda@axentia.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

\
 
 \ /
  Last update: 2023-11-20 13:54    [W:0.031 / U:2.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site