Re: [PATCH v4 0/9] treewide: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files

From: Thomas Huth

Date: Fri Nov 21 2025 - 05:07:19 EST


On 21/11/2025 11.00, Thomas Huth wrote:
Hi Arnd!

Could you please help to get the remaining patches of this macro
renaming series merged? I already got most patches from the initial
version merged through the architecture specific trees (thanks to every
maintainer who helped me here!), but for alpha and arm 32-bit, I did
not manage to get the attention of the maintainers. Hexagon got an
Acked-by by Brian, but the patches did not get merged yet.

Sorry, forgot to mention: csky and arm64 are still in linux-next and not in Linus' master branch yet, so they need to get merged first.

Thomas


Anyway, original patch series description follows:

The kernel Makefiles define the __ASSEMBLY__ macro to provide
a way to use headers in both, assembly and C source code.
However, all the supported versions of the GCC and Clang compilers
also define the macro __ASSEMBLER__ automatically already when compiling
assembly code, so some kernel headers are using __ASSEMBLER__ instead.
With regards to userspace code, this seems also to be constant source
of confusion, see for example these links here:

https://lore.kernel.org/kvm/20250222014526.2302653-1-seanjc@xxxxxxxxxx/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199

To avoid confusion in the future, it would make sense to standardize
on the macro that gets defined by the compiler, so this patch series
changes all occurances of __ASSEMBLY__ into __ASSEMBLER__ and
finally removes the -D__ASSEMBLY__ from the Makefiles.

I split the patches per architecture to ease the review, and I also
split the uapi headers from the normal ones in case we decide that
uapi needs to be treated differently from the normal headers here.

v4:
- Most patches from the original series got already merged via the
tree of the individual architectures, so the amount of patches here
has been greatly reduced
- Rebased patches on top of linux-next, fixed conflicts and new
occurances

Thomas Huth (9):
alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers
arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
include: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
x86/headers: Replace __ASSEMBLY__ stragglers with __ASSEMBLER__
treewide: Stop defining __ASSEMBLY__ for assembler files