Re: [PATCH v2 1/1] arm64: remove unnecessary ifdefs around is_compat_task()
From: Leonardo Bras
Date: Tue Jan 09 2024 - 13:19:50 EST
On Tue, Jan 09, 2024 at 07:18:46AM +0100, Arnd Bergmann wrote:
> On Mon, Jan 8, 2024, at 18:43, Leonardo Bras wrote:
> > Currently some parts of the codebase will test for CONFIG_COMPAT before
> > testing is_compat_task().
> >
> > is_compat_task() is a inlined function only present on CONFIG_COMPAT.
> > On the other hand, for !CONFIG_COMPAT, we have in linux/compat.h:
> >
> > #define is_compat_task() (0)
> >
> > Since we have this define available in every usage of is_compat_task() for
> > !CONFIG_COMPAT, it's unnecessary to keep the ifdefs, since the compiler is
> > smart enough to optimize-out those snippets on CONFIG_COMPAT=n
> >
> > This requires some regset code as well as a few other defines to be made
> > available on !CONFIG_COMPAT, so some symbols can get resolved before
> > getting optimized-out.
> >
> > Signed-off-by: Leonardo Bras <leobras@xxxxxxxxxx>
> > ---
> > Changes since v1:
> > - Move some regset code and other defines outside of CONFIG_COMPAT
> > - Closes:
> > https://lore.kernel.org/oe-kbuild-all/202401061219.Y2LD7LTx-lkp@xxxxxxxxx/
> > Link:
> > https://lore.kernel.org/all/20240105041458.126602-3-leobras@xxxxxxxxxx/
>
> Looks good to me, and did not cause any regressions in an overnight
> randconfig build loop.
>
> Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>
>
Thanks!
Leo