Skip to contentSkip to conversation

x86/alternative: clean up asm/alternative.h

PATCH In review Juergen Gross 2 participants 2 messages May 5, 2025 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/alternative: clean up asm/alternative.h

Remove some unused macros in arch/x86/include/asm/alternative.h which could potentially result in weird build failures.

Fixes 1a6ade825079 ("x86/alternative: Convert the asm ALTERNATIVE_3() macro")
---
 arch/x86/include/asm/alternative.h | 5 -----
 1 file changed, 5 deletions(-)
arch/x86/include/asm/alternative.h +0 -5
index 4a37a8bd87fd..8359ed0f2090 100644
@@ -335,11 +335,6 @@ void nop_func(void);
 	__ALTERNATIVE(\oldinstr, \newinstr, \ft_flags)
 .endm
 
-#define old_len			141b-140b
-#define new_len1		144f-143f
-#define new_len2		145f-144f
-#define new_len3		146f-145f
-
 /*
  * Same as ALTERNATIVE macro above but for two alternatives. If CPU
  * has @feature1, it replaces @oldinstr with @newinstr1. If CPU has
Signature · 1 line
2.43.0
#1 lore raw

arch/x86/include/asm/alternative.h void nop_func(void); · line 341

Quoted 4 lines · Juergen Gross
arch/x86/include/asm/alternative.h +0 -4
-#define old_len			141b-140b
-#define new_len1		144f-143f
-#define new_len2		145f-144f
-#define new_len3		146f-145f

I was surprised these haven't already broken the build, but they're under an #ifdef __ASSEMBLER__ which I guess limits the damage.

Also, just a little note: The subject here is a bit anemic. I can pretty easily and unambiguously tell the file from the diffstat. Wouldn't something like this be slightly more helpful?

x86/alternative: Remove unused header #defines