Skip to contentSkip to conversation

x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return()

PATCH RESEND Applied Uros Bizjak 2 participants 2 messages Mar 8 x86

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 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.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/include/asm/local.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/local.h +1 -1
index 59aa966dc212..4957018fef3e 100644
@@ -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;
Signature · 1 line
2.53.0
merge bot Applied
#1 lore raw
The following commit has been merged into the x86/cleanups branch of tip:

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 <[email protected]>
AuthorDate:    Sun, 08 Mar 2026 18:12:35 +01:00
Committer:     Borislav Petkov (AMD) <[email protected]>
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.

---
 arch/x86/include/asm/local.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/local.h +1 -1
index 59aa966..4957018 100644
@@ -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;