Skip to contentSkip to conversation

kexec: Replace __ASSEMBLY__ with __ASSEMBLER__ in header file

PATCH Applied Thomas Huth 3 participants 3 messages Jun 19 – Jul 1

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: Replace __ASSEMBLY__ with __ASSEMBLER__ in header file

From: Thomas Huth <[email protected]>

While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize now on the __ASSEMBLER__ macro that is provided by the compilers.

---
Note: This patch has been split from an earlier bigger patch of mine to ease reviewing.

 include/linux/kexec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kexec.h +1 -1
index 8a22bc9b8c6c8..0af8ae4fdd087 100644
@@ -13,7 +13,7 @@
 #define IND_SOURCE       (1 << IND_SOURCE_BIT)
 #define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
 
-#if !defined(__ASSEMBLY__)
+#if !defined(__ASSEMBLER__)
 
 #include <linux/vmcore_info.h>
 #include <linux/crash_reserve.h>
Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Thomas Huth

From: Thomas Huth <[email protected]>

While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize now on the __ASSEMBLER__ macro that is provided by the compilers.

Sounds reasonable.

Quoted 2 lines

[...]

Signature · 2 lines
Regards,
Pratyush Yadav