[PATCH v2 -next] perf/marvell: cn10k Fix build error without CONFIG_OF

Arnd Bergmann arnd at arndb.de
Thu Mar 10 02:29:47 PST 2022


On Thu, Mar 10, 2022 at 11:21 AM Will Deacon <will at kernel.org> wrote:
> On Thu, Mar 10, 2022 at 11:04:21AM +0100, Arnd Bergmann wrote:
> > On Thu, Mar 10, 2022 at 10:58 AM Will Deacon <will at kernel.org> wrote:
>
> I think the problem is when the #ifdefs are removed but the use of
> of_match_ptr() remains, leading to reports from the robot:
>
> https://lore.kernel.org/r/202201041700.01KZEzhb-lkp@intel.com
>
> Should we therefore remove of_match_ptr() altogether? It seems like it's
> leading people in the wrong direction here.

There may be valid uses for it, e.g. if the array referenced by it is
in a separate, and conditionally compiled file, or if the #ifdef block
covers more than just the table.

Removing 1563 instances of it also takes a lot of work. Almost
all of them are probably useless, and quite a lot of them are
actively wrong, because they refer to arrays without an #ifdef.

Maybe coccinelle can help here.

        Arnd



More information about the linux-arm-kernel mailing list