[PATCH v2 0/2] m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers

Thomas Huth posted 2 patches 4 months ago
arch/m68k/include/asm/adb_iop.h           |  4 ++--
arch/m68k/include/asm/bootinfo.h          |  4 ++--
arch/m68k/include/asm/entry.h             |  4 ++--
arch/m68k/include/asm/kexec.h             |  4 ++--
arch/m68k/include/asm/mac_baboon.h        |  4 ++--
arch/m68k/include/asm/mac_iop.h           |  4 ++--
arch/m68k/include/asm/mac_oss.h           |  4 ++--
arch/m68k/include/asm/mac_psc.h           |  4 ++--
arch/m68k/include/asm/mac_via.h           |  4 ++--
arch/m68k/include/asm/math-emu.h          |  6 +++---
arch/m68k/include/asm/mcf_pgtable.h       |  4 ++--
arch/m68k/include/asm/mcfmmu.h            |  2 +-
arch/m68k/include/asm/motorola_pgtable.h  |  4 ++--
arch/m68k/include/asm/nettel.h            |  4 ++--
arch/m68k/include/asm/openprom.h          |  4 ++--
arch/m68k/include/asm/page.h              |  4 ++--
arch/m68k/include/asm/page_mm.h           |  4 ++--
arch/m68k/include/asm/page_no.h           |  4 ++--
arch/m68k/include/asm/pgtable.h           |  2 +-
arch/m68k/include/asm/pgtable_mm.h        |  8 ++++----
arch/m68k/include/asm/ptrace.h            |  4 ++--
arch/m68k/include/asm/setup.h             | 10 +++++-----
arch/m68k/include/asm/sun3_pgtable.h      |  8 ++++----
arch/m68k/include/asm/sun3mmu.h           |  4 ++--
arch/m68k/include/asm/thread_info.h       |  6 +++---
arch/m68k/include/asm/traps.h             |  6 +++---
arch/m68k/include/uapi/asm/bootinfo-vme.h |  4 ++--
arch/m68k/include/uapi/asm/bootinfo.h     |  8 ++++----
arch/m68k/include/uapi/asm/ptrace.h       |  4 ++--
arch/m68k/math-emu/fp_emu.h               |  8 ++++----
30 files changed, 72 insertions(+), 72 deletions(-)
[PATCH v2 0/2] m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
Posted by Thomas Huth 4 months ago
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@google.com/
 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__.

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.

The x86, parisc and sh patches already got merged via their specific
architecture tree:

 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefda

So I assume the m68k patches should go via the m68k tree.

v2:
- Split the m68k patches from the global series
  (see https://lore.kernel.org/all/20250314071013.1575167-1-thuth@redhat.com/)
- Rebased the patches on linux-next and fixed the conflicts
  and new occurances of __ASSEMBLY__

Thomas Huth (2):
  m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
  m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers

 arch/m68k/include/asm/adb_iop.h           |  4 ++--
 arch/m68k/include/asm/bootinfo.h          |  4 ++--
 arch/m68k/include/asm/entry.h             |  4 ++--
 arch/m68k/include/asm/kexec.h             |  4 ++--
 arch/m68k/include/asm/mac_baboon.h        |  4 ++--
 arch/m68k/include/asm/mac_iop.h           |  4 ++--
 arch/m68k/include/asm/mac_oss.h           |  4 ++--
 arch/m68k/include/asm/mac_psc.h           |  4 ++--
 arch/m68k/include/asm/mac_via.h           |  4 ++--
 arch/m68k/include/asm/math-emu.h          |  6 +++---
 arch/m68k/include/asm/mcf_pgtable.h       |  4 ++--
 arch/m68k/include/asm/mcfmmu.h            |  2 +-
 arch/m68k/include/asm/motorola_pgtable.h  |  4 ++--
 arch/m68k/include/asm/nettel.h            |  4 ++--
 arch/m68k/include/asm/openprom.h          |  4 ++--
 arch/m68k/include/asm/page.h              |  4 ++--
 arch/m68k/include/asm/page_mm.h           |  4 ++--
 arch/m68k/include/asm/page_no.h           |  4 ++--
 arch/m68k/include/asm/pgtable.h           |  2 +-
 arch/m68k/include/asm/pgtable_mm.h        |  8 ++++----
 arch/m68k/include/asm/ptrace.h            |  4 ++--
 arch/m68k/include/asm/setup.h             | 10 +++++-----
 arch/m68k/include/asm/sun3_pgtable.h      |  8 ++++----
 arch/m68k/include/asm/sun3mmu.h           |  4 ++--
 arch/m68k/include/asm/thread_info.h       |  6 +++---
 arch/m68k/include/asm/traps.h             |  6 +++---
 arch/m68k/include/uapi/asm/bootinfo-vme.h |  4 ++--
 arch/m68k/include/uapi/asm/bootinfo.h     |  8 ++++----
 arch/m68k/include/uapi/asm/ptrace.h       |  4 ++--
 arch/m68k/math-emu/fp_emu.h               |  8 ++++----
 30 files changed, 72 insertions(+), 72 deletions(-)

-- 
2.49.0
Re: [PATCH v2 0/2] m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
Posted by Geert Uytterhoeven 3 months ago
On Wed, 11 Jun 2025 at 13:41, Thomas Huth <thuth@redhat.com> wrote:
> 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@google.com/
>  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__.
>
> 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.
>
> The x86, parisc and sh patches already got merged via their specific
> architecture tree:
>
>  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
>  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
>  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
>  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
>  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefda
>
> So I assume the m68k patches should go via the m68k tree.
>
> v2:
> - Split the m68k patches from the global series
>   (see https://lore.kernel.org/all/20250314071013.1575167-1-thuth@redhat.com/)
> - Rebased the patches on linux-next and fixed the conflicts
>   and new occurances of __ASSEMBLY__
>
> Thomas Huth (2):
>   m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
>   m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k tree for v6.17.

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH v2 0/2] m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
Posted by Greg Ungerer 3 months, 1 week ago
Hi Thomas,

On 11/6/25 21:40, Thomas Huth wrote:
> 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@google.com/
>   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__.
> 
> 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.
> 
> The x86, parisc and sh patches already got merged via their specific
> architecture tree:
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefda
> 
> So I assume the m68k patches should go via the m68k tree.

Looks good to me, for the whole series:

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Thanks
Greg



> v2:
> - Split the m68k patches from the global series
>    (see https://lore.kernel.org/all/20250314071013.1575167-1-thuth@redhat.com/)
> - Rebased the patches on linux-next and fixed the conflicts
>    and new occurances of __ASSEMBLY__
> 
> Thomas Huth (2):
>    m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
>    m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
> 
>   arch/m68k/include/asm/adb_iop.h           |  4 ++--
>   arch/m68k/include/asm/bootinfo.h          |  4 ++--
>   arch/m68k/include/asm/entry.h             |  4 ++--
>   arch/m68k/include/asm/kexec.h             |  4 ++--
>   arch/m68k/include/asm/mac_baboon.h        |  4 ++--
>   arch/m68k/include/asm/mac_iop.h           |  4 ++--
>   arch/m68k/include/asm/mac_oss.h           |  4 ++--
>   arch/m68k/include/asm/mac_psc.h           |  4 ++--
>   arch/m68k/include/asm/mac_via.h           |  4 ++--
>   arch/m68k/include/asm/math-emu.h          |  6 +++---
>   arch/m68k/include/asm/mcf_pgtable.h       |  4 ++--
>   arch/m68k/include/asm/mcfmmu.h            |  2 +-
>   arch/m68k/include/asm/motorola_pgtable.h  |  4 ++--
>   arch/m68k/include/asm/nettel.h            |  4 ++--
>   arch/m68k/include/asm/openprom.h          |  4 ++--
>   arch/m68k/include/asm/page.h              |  4 ++--
>   arch/m68k/include/asm/page_mm.h           |  4 ++--
>   arch/m68k/include/asm/page_no.h           |  4 ++--
>   arch/m68k/include/asm/pgtable.h           |  2 +-
>   arch/m68k/include/asm/pgtable_mm.h        |  8 ++++----
>   arch/m68k/include/asm/ptrace.h            |  4 ++--
>   arch/m68k/include/asm/setup.h             | 10 +++++-----
>   arch/m68k/include/asm/sun3_pgtable.h      |  8 ++++----
>   arch/m68k/include/asm/sun3mmu.h           |  4 ++--
>   arch/m68k/include/asm/thread_info.h       |  6 +++---
>   arch/m68k/include/asm/traps.h             |  6 +++---
>   arch/m68k/include/uapi/asm/bootinfo-vme.h |  4 ++--
>   arch/m68k/include/uapi/asm/bootinfo.h     |  8 ++++----
>   arch/m68k/include/uapi/asm/ptrace.h       |  4 ++--
>   arch/m68k/math-emu/fp_emu.h               |  8 ++++----
>   30 files changed, 72 insertions(+), 72 deletions(-)
>