mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Yury Norov <yury.norov@gmail.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bitmap: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
Date: Fri, 19 Jun 2026 09:47:31 -0400	[thread overview]
Message-ID: <ajVIc-3XQYgpKtuB@yury> (raw)
In-Reply-To: <20260619113441.146717-1-thuth@redhat.com>

On Fri, Jun 19, 2026 at 01:34:41PM +0200, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> 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.
> 
> This is a completely mechanical patch (done with a simple "sed -i"
> statement).
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Added in bitmap-for-next for testing.

Thanks,
Yury

> ---
>  Note: This patch has been split from an earlier patch of mine
>  to ease reviewing.
> 
>  include/linux/bitmap.h     | 4 ++--
>  include/linux/bits.h       | 6 +++---
>  tools/include/linux/bits.h | 6 +++---
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
> index b007d54a9036a..8854acf77869a 100644
> --- a/include/linux/bitmap.h
> +++ b/include/linux/bitmap.h
> @@ -2,7 +2,7 @@
>  #ifndef __LINUX_BITMAP_H
>  #define __LINUX_BITMAP_H
>  
> -#ifndef __ASSEMBLY__
> +#ifndef __ASSEMBLER__
>  
>  #include <linux/align.h>
>  #include <linux/bitops.h>
> @@ -894,6 +894,6 @@ void bitmap_write(unsigned long *map, unsigned long value,
>  #define bitmap_set_value8(map, value, start)		\
>  	bitmap_write(map, value, start, BITS_PER_BYTE)
>  
> -#endif /* __ASSEMBLY__ */
> +#endif /* __ASSEMBLER__ */
>  
>  #endif /* __LINUX_BITMAP_H */
> diff --git a/include/linux/bits.h b/include/linux/bits.h
> index a40cc861b3a7c..b7509f15718e6 100644
> --- a/include/linux/bits.h
> +++ b/include/linux/bits.h
> @@ -17,7 +17,7 @@
>   * position @h. For example
>   * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
>   */
> -#if !defined(__ASSEMBLY__)
> +#if !defined(__ASSEMBLER__)
>  
>  /*
>   * Missing asm support
> @@ -75,7 +75,7 @@
>  #define BIT_U32(nr)	BIT_TYPE(u32, nr)
>  #define BIT_U64(nr)	BIT_TYPE(u64, nr)
>  
> -#else /* defined(__ASSEMBLY__) */
> +#else /* defined(__ASSEMBLER__) */
>  
>  /*
>   * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
> @@ -84,6 +84,6 @@
>  #define GENMASK(h, l)		__GENMASK(h, l)
>  #define GENMASK_ULL(h, l)	__GENMASK_ULL(h, l)
>  
> -#endif /* !defined(__ASSEMBLY__) */
> +#endif /* !defined(__ASSEMBLER__) */
>  
>  #endif	/* __LINUX_BITS_H */
> diff --git a/tools/include/linux/bits.h b/tools/include/linux/bits.h
> index a40cc861b3a7c..b7509f15718e6 100644
> --- a/tools/include/linux/bits.h
> +++ b/tools/include/linux/bits.h
> @@ -17,7 +17,7 @@
>   * position @h. For example
>   * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
>   */
> -#if !defined(__ASSEMBLY__)
> +#if !defined(__ASSEMBLER__)
>  
>  /*
>   * Missing asm support
> @@ -75,7 +75,7 @@
>  #define BIT_U32(nr)	BIT_TYPE(u32, nr)
>  #define BIT_U64(nr)	BIT_TYPE(u64, nr)
>  
> -#else /* defined(__ASSEMBLY__) */
> +#else /* defined(__ASSEMBLER__) */
>  
>  /*
>   * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
> @@ -84,6 +84,6 @@
>  #define GENMASK(h, l)		__GENMASK(h, l)
>  #define GENMASK_ULL(h, l)	__GENMASK_ULL(h, l)
>  
> -#endif /* !defined(__ASSEMBLY__) */
> +#endif /* !defined(__ASSEMBLER__) */
>  
>  #endif	/* __LINUX_BITS_H */
> -- 
> 2.54.0

      reply	other threads:[~2026-06-19 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 11:34 Thomas Huth
2026-06-19 13:47 ` Yury Norov [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=ajVIc-3XQYgpKtuB@yury \
    --to=yury.norov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=thuth@redhat.com \
    /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

Powered by JetHome