linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Thomas Huth <thuth@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Geoff Levand <geoff@infradead.org>,
	Naveen N Rao <naveen@kernel.org>
Subject: Re: [PATCH v2 0/2] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
Date: Tue, 10 Jun 2025 15:00:28 -0500	[thread overview]
Message-ID: <20250610200028.GE30295@gate.crashing.org> (raw)
In-Reply-To: <20250610160128.69033-1-thuth@redhat.com>

On Tue, Jun 10, 2025 at 06:01:26PM +0200, 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:

Any symbol name starting with two underscores is reserved for any use.

That also means that the kernel (being user code!) is not allowed to use
such for its own use.

But the kernel historically defines stuff in this namespace anyway.  Of
course it cannot prohibit others to do the same though!

> 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__.

GCC already defines __ASSEMBLER__ when compiling assembler code (a .s
or .S file, usually).  LLVM should do the same, it promises to be
compatible to GCC for all user code, after all.


Segher


      parent reply	other threads:[~2025-06-10 20:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 16:01 [PATCH v2 0/2] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files Thomas Huth
2025-06-10 16:01 ` [PATCH v2 1/2] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-06-10 20:12   ` Segher Boessenkool
2025-06-11  5:48     ` Thomas Huth
2025-06-10 16:01 ` [PATCH v2 2/2] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-06-10 20:26   ` Segher Boessenkool
2025-06-11  5:55     ` Thomas Huth
2025-06-11 13:47       ` Segher Boessenkool
2025-06-10 20:00 ` Segher Boessenkool [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=20250610200028.GE30295@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=geoff@infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).