Re: [PATCH 2/5] ARM: uapi: Stop leaking CONFIG_CPU_ENDIAN_BE8 reference to userspace

"Arnd Bergmann" <[email protected]>
Newsgroups org.infradead.lists.linux-snps-arc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Dec 30, 2025, at 08:10, Thomas Weißschuh wrote:
> UAPI headers are not supposed to leak references to kconfig symbols.
> These won't be set when building userspace. Hide the kconfig reference
> behind 'if defined(__KERNEL__)', so it will be stripped by
> headers_install.sh, the same way other kconfig references in this file
> are handled. The result for userspace will be the same, but the
> exception in headers_install.sh can also be removed.
>
> Signed-off-by: Thomas Weißschuh <[email protected]>

According to codesearch.debian.net, there are no actual users of
this definition outside of the kernel, and there really shouldn't
be either.

It should be both safe and correct to open-code PSR_ENDSTATE
in the two file where it is used as

 if (IS_ENABLED(CONFIG_CPU_ENDIAN_BE8))
        regs->ARM_cpsr |= PSR_E_BIT

and then remove the definition from the header. Alternatively
it could be moved into the non-uapi header, or you can have
an #ifdef around both of them.

     Arnd

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.