From: Thomas Huth <thuth@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
Date: Tue, 22 Sep 2026 08:13:49 +0200 [thread overview]
Message-ID: <990c48e8-7604-455f-a2eb-915b1af352b0@redhat.com> (raw)
In-Reply-To: <20260821085201.226650-1-thuth@redhat.com>
On 21/08/2026 10.52, Thomas Huth wrote:
> 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>
> ---
> Note: This has been split from an earlier bigger patch of mine into
> this separate patch to ease reviewing
>
> 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(-)
Friendly ping?
> 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 */
prev parent reply other threads:[~2026-09-22 6:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 8:52 [PATCH] asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2026-09-22 6:13 ` Thomas Huth [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=990c48e8-7604-455f-a2eb-915b1af352b0@redhat.com \
--to=thuth@redhat.com \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).