Skip to content

Commit fb53a9a

Browse files
jones-drewAlexandre Ghiti
authored andcommitted
riscv: Provide all alternative macros all the time
We need to provide all six forms of the alternative macros (ALTERNATIVE, ALTERNATIVE_2, _ALTERNATIVE_CFG, _ALTERNATIVE_CFG_2, __ALTERNATIVE_CFG, __ALTERNATIVE_CFG_2) for all four cases derived from the two ifdefs (RISCV_ALTERNATIVE, __ASSEMBLY__) in order to ensure all configs can compile. Define this missing ones and ensure all are defined to consume all parameters passed. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202504130710.3IKz6Ibs-lkp@intel.com/ Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20250414120947.135173-2-ajones@ventanamicro.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent 1ee1313 commit fb53a9a

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

arch/riscv/include/asm/alternative-macros.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,19 @@
115115
\old_c
116116
.endm
117117

118-
#define _ALTERNATIVE_CFG(old_c, ...) \
119-
ALTERNATIVE_CFG old_c
120-
121-
#define _ALTERNATIVE_CFG_2(old_c, ...) \
122-
ALTERNATIVE_CFG old_c
118+
#define __ALTERNATIVE_CFG(old_c, ...) ALTERNATIVE_CFG old_c
119+
#define __ALTERNATIVE_CFG_2(old_c, ...) ALTERNATIVE_CFG old_c
123120

124121
#else /* !__ASSEMBLY__ */
125122

126-
#define __ALTERNATIVE_CFG(old_c) \
127-
old_c "\n"
123+
#define __ALTERNATIVE_CFG(old_c, ...) old_c "\n"
124+
#define __ALTERNATIVE_CFG_2(old_c, ...) old_c "\n"
128125

129-
#define _ALTERNATIVE_CFG(old_c, ...) \
130-
__ALTERNATIVE_CFG(old_c)
126+
#endif /* __ASSEMBLY__ */
131127

132-
#define _ALTERNATIVE_CFG_2(old_c, ...) \
133-
__ALTERNATIVE_CFG(old_c)
128+
#define _ALTERNATIVE_CFG(old_c, ...) __ALTERNATIVE_CFG(old_c)
129+
#define _ALTERNATIVE_CFG_2(old_c, ...) __ALTERNATIVE_CFG_2(old_c)
134130

135-
#endif /* __ASSEMBLY__ */
136131
#endif /* CONFIG_RISCV_ALTERNATIVE */
137132

138133
/*

0 commit comments

Comments
 (0)