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

From: Will Deacon
Date: Thu Mar 10 2022 - 05:21:36 EST


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:
> > On Thu, Mar 10, 2022 at 02:50:45PM +0800, YueHaibing wrote:
> >
> > Ah, sorry, I already fixed this when the conflict was first reported:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/perf&id=6676a42f1e4f1b8ec166b723a3801b7113c25a0e
> >
> > However, I thought this driver could be compile-tested on architectures
> > without OF and then we'd get some report from that? At least, I'm certain
> > I've _added_ these ifdefs to other PMU drivers in the past.
>
> The #ifdefs are never really needed, the only reason to have them is
> to save a few bytes on architectures that don't normally use DT,
> at the expense of making it slightly less readable.
>
> For compile-testing purposes we don't care about the size of the module,
> and compiling in the table unconditionally is easier.

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.

Will