* [PATCH RESEND] x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return()
@ 2026-03-08 17:12 Uros Bizjak
2026-03-08 19:13 ` [tip: x86/cleanups] " tip-bot2 for Uros Bizjak
0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2026-03-08 17:12 UTC (permalink / raw)
To: x86, linux-kernel
Cc: Uros Bizjak, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin
Remove the trailing semicolon from the inline assembly statement in
local_add_return().
The _ASM_XADD macro already expands to a complete instruction, making
the extra semicolon unnecessary. More importantly, the stray semicolon
causes GCC to treat the inline asm as containing multiple instructions,
which can skew its internal instruction count estimation and affect
optimization heuristics.
No functional change intended.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
arch/x86/include/asm/local.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 59aa966dc212..4957018fef3e 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -106,7 +106,7 @@ static inline bool local_add_negative(long i, local_t *l)
static inline long local_add_return(long i, local_t *l)
{
long __i = i;
- asm volatile(_ASM_XADD "%0, %1;"
+ asm volatile(_ASM_XADD "%0, %1"
: "+r" (i), "+m" (l->a.counter)
: : "memory");
return i + __i;
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip: x86/cleanups] x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return()
2026-03-08 17:12 [PATCH RESEND] x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return() Uros Bizjak
@ 2026-03-08 19:13 ` tip-bot2 for Uros Bizjak
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Uros Bizjak @ 2026-03-08 19:13 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Uros Bizjak, Borislav Petkov (AMD), x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: ceea7868b594ccf376562af40b9463d9f2fb7dd0
Gitweb: https://git.kernel.org/tip/ceea7868b594ccf376562af40b9463d9f2fb7dd0
Author: Uros Bizjak <ubizjak@gmail.com>
AuthorDate: Sun, 08 Mar 2026 18:12:35 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sun, 08 Mar 2026 19:56:49 +01:00
x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return()
Remove the trailing semicolon from the inline assembly statement in
local_add_return().
The _ASM_XADD macro already expands to a complete instruction, making
the extra semicolon unnecessary. More importantly, the stray semicolon
causes GCC to treat the inline asm as containing multiple instructions,
which can skew its internal instruction count estimation and affect
optimization heuristics.
No functional change intended.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260308171250.7278-1-ubizjak@gmail.com
---
arch/x86/include/asm/local.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 59aa966..4957018 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -106,7 +106,7 @@ static inline bool local_add_negative(long i, local_t *l)
static inline long local_add_return(long i, local_t *l)
{
long __i = i;
- asm volatile(_ASM_XADD "%0, %1;"
+ asm volatile(_ASM_XADD "%0, %1"
: "+r" (i), "+m" (l->a.counter)
: : "memory");
return i + __i;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-08 19:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-08 17:12 [PATCH RESEND] x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return() Uros Bizjak
2026-03-08 19:13 ` [tip: x86/cleanups] " tip-bot2 for Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®