* [PATCH v5 09/13] asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
[not found] <20261023064908.66707-1-thuth@redhat.com>
@ 2026-10-23 6:48 ` Thomas Huth
2026-10-23 6:48 ` [PATCH v5 11/13] asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
1 sibling, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2026-10-23 6:48 UTC (permalink / raw)
To: Arnd Bergmann, Nathan Chancellor, Nicolas Schier
Cc: soc, linux-kernel, linux-kbuild, Thomas Weißschuh,
linux-arch
__ASSEMBLY__ is only defined by the Makefile of the kernel, so
this is not really useful for uapi headers (unless the userspace
Makefile defines it, too). Let's switch to __ASSEMBLER__ which
gets set automatically by the compiler when compiling assembly
code.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/uapi/asm-generic/int-l64.h | 4 ++--
include/uapi/asm-generic/int-ll64.h | 4 ++--
include/uapi/asm-generic/signal-defs.h | 2 +-
include/uapi/asm-generic/signal.h | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/uapi/asm-generic/int-l64.h b/include/uapi/asm-generic/int-l64.h
index ed8bcd99c34d7..f840806bbe7e9 100644
--- a/include/uapi/asm-generic/int-l64.h
+++ b/include/uapi/asm-generic/int-l64.h
@@ -11,7 +11,7 @@
#include <asm/bitsperlong.h>
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space
@@ -29,7 +29,7 @@ typedef unsigned int __u32;
typedef __signed__ long __s64;
typedef unsigned long __u64;
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* _UAPI_ASM_GENERIC_INT_L64_H */
diff --git a/include/uapi/asm-generic/int-ll64.h b/include/uapi/asm-generic/int-ll64.h
index 1ed06964257c3..4fc3e882bcff9 100644
--- a/include/uapi/asm-generic/int-ll64.h
+++ b/include/uapi/asm-generic/int-ll64.h
@@ -11,7 +11,7 @@
#include <asm/bitsperlong.h>
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space
@@ -34,7 +34,7 @@ typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* _UAPI_ASM_GENERIC_INT_LL64_H */
diff --git a/include/uapi/asm-generic/signal-defs.h b/include/uapi/asm-generic/signal-defs.h
index 7572f2f46ee89..4073143fa3dae 100644
--- a/include/uapi/asm-generic/signal-defs.h
+++ b/include/uapi/asm-generic/signal-defs.h
@@ -78,7 +78,7 @@
#define SIG_SETMASK 2 /* for setting the signal mask */
#endif
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
typedef void __signalfn_t(int);
typedef __signalfn_t __user *__sighandler_t;
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 0eb69dc8e5722..6b089d4b2965b 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -57,7 +57,7 @@
#define SIGSTKSZ 8192
#endif
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
typedef struct {
unsigned long sig[_NSIG_WORDS];
} sigset_t;
@@ -88,6 +88,6 @@ typedef struct sigaltstack {
__kernel_size_t ss_size;
} stack_t;
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* _UAPI__ASM_GENERIC_SIGNAL_H */
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH v5 11/13] asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
[not found] <20261023064908.66707-1-thuth@redhat.com>
2026-10-23 6:48 ` [PATCH v5 09/13] asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
@ 2026-10-23 6:48 ` Thomas Huth
1 sibling, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2026-10-23 6:48 UTC (permalink / raw)
To: Arnd Bergmann, Nathan Chancellor, Nicolas Schier
Cc: soc, linux-kernel, linux-kbuild, Thomas Weißschuh,
Nick Desaulniers, Bill Wendling, Justin Stitt, linux-arch, llvm
While the GCC and Clang compilers already define __ASSEMBLER__ auto-
matically 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. Let's standardize now on the __ASSEMBLER__ macro to avoid
this confusion.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/asm-generic/barrier.h | 4 ++--
include/asm-generic/bug.h | 4 ++--
include/asm-generic/current.h | 2 +-
include/asm-generic/error-injection.h | 2 +-
include/asm-generic/int-ll64.h | 6 +++---
include/asm-generic/rwonce.h | 4 ++--
include/asm-generic/signal.h | 4 ++--
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h
index b99cb57dfcccc..c029b1e1854c4 100644
--- a/include/asm-generic/barrier.h
+++ b/include/asm-generic/barrier.h
@@ -11,7 +11,7 @@
#ifndef __ASM_GENERIC_BARRIER_H
#define __ASM_GENERIC_BARRIER_H
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <linux/compiler.h>
#include <linux/kcsan-checks.h>
@@ -302,5 +302,5 @@ do { \
# define smp_mb__after_switch_mm() smp_mb()
#endif
-#endif /* !__ASSEMBLY__ */
+#endif /* !__ASSEMBLER__ */
#endif /* __ASM_GENERIC_BARRIER_H */
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 09e8eccee8ed9..044ebc96f373c 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -26,7 +26,7 @@
#endif
#endif /* WARN_CONDITION_STR */
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <linux/panic.h>
#include <linux/printk.h>
@@ -258,6 +258,6 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
# define WARN_ON_SMP(x) ({0;})
#endif
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif
diff --git a/include/asm-generic/current.h b/include/asm-generic/current.h
index 9c2aeecbd05a6..8e7d8f019377f 100644
--- a/include/asm-generic/current.h
+++ b/include/asm-generic/current.h
@@ -2,7 +2,7 @@
#ifndef __ASM_GENERIC_CURRENT_H
#define __ASM_GENERIC_CURRENT_H
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <linux/thread_info.h>
#define get_current() (current_thread_info()->task)
diff --git a/include/asm-generic/error-injection.h b/include/asm-generic/error-injection.h
index b05253f68eaa5..0a9ec33fa8f20 100644
--- a/include/asm-generic/error-injection.h
+++ b/include/asm-generic/error-injection.h
@@ -2,7 +2,7 @@
#ifndef _ASM_GENERIC_ERROR_INJECTION_H
#define _ASM_GENERIC_ERROR_INJECTION_H
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__KERNEL__) && !defined(__ASSEMBLER__)
enum {
EI_ETYPE_NULL, /* Return NULL if failure */
EI_ETYPE_ERRNO, /* Return -ERRNO if failure */
diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h
index a248545f1e18c..58974e8abbfae 100644
--- a/include/asm-generic/int-ll64.h
+++ b/include/asm-generic/int-ll64.h
@@ -11,7 +11,7 @@
#include <uapi/asm-generic/int-ll64.h>
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
typedef __s8 s8;
typedef __u8 u8;
@@ -31,7 +31,7 @@ typedef __u64 u64;
#define S64_C(x) x ## LL
#define U64_C(x) x ## ULL
-#else /* __ASSEMBLY__ */
+#else /* __ASSEMBLER__ */
#define S8_C(x) x
#define U8_C(x) x
@@ -42,6 +42,6 @@ typedef __u64 u64;
#define S64_C(x) x
#define U64_C(x) x
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* _ASM_GENERIC_INT_LL64_H */
diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h
index 52b969c7cef93..c35b262ee4223 100644
--- a/include/asm-generic/rwonce.h
+++ b/include/asm-generic/rwonce.h
@@ -20,7 +20,7 @@
#ifndef __ASM_GENERIC_RWONCE_H
#define __ASM_GENERIC_RWONCE_H
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <linux/compiler_types.h>
#include <linux/kasan-checks.h>
@@ -94,5 +94,5 @@ unsigned long read_word_at_a_time(const void *addr)
return *(unsigned long *)addr;
}
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* __ASM_GENERIC_RWONCE_H */
diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h
index 663dd6d0795dc..392e59fd3d8b9 100644
--- a/include/asm-generic/signal.h
+++ b/include/asm-generic/signal.h
@@ -4,10 +4,10 @@
#include <uapi/asm-generic/signal.h>
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <asm/sigcontext.h>
#undef __HAVE_ARCH_SIG_BITOPS
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* _ASM_GENERIC_SIGNAL_H */
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread