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

From: Arnd Bergmann
Date: Thu Mar 10 2022 - 05:30:11 EST


On Thu, Mar 10, 2022 at 11:21 AM Will Deacon <will@xxxxxxxxxx> 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@xxxxxxxxxx> 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@xxxxxxxxx
>
> 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