* [PATCH] riscv: Provide all alternative macros all the time
@ 2025-04-14 12:09 Andrew Jones
2025-04-14 13:05 ` Alexandre Ghiti
2025-04-16 18:42 ` patchwork-bot+linux-riscv
0 siblings, 2 replies; 3+ messages in thread
From: Andrew Jones @ 2025-04-14 12:09 UTC (permalink / raw)
To: linux-riscv, linux-kernel
Cc: paul.walmsley, palmer, alex, conor.dooley, oe-kbuild-all, charlie,
samuel.holland, kernel test robot
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>
---
arch/riscv/include/asm/alternative-macros.h | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
index 721ec275ce57..231d777d936c 100644
--- a/arch/riscv/include/asm/alternative-macros.h
+++ b/arch/riscv/include/asm/alternative-macros.h
@@ -115,24 +115,19 @@
\old_c
.endm
-#define _ALTERNATIVE_CFG(old_c, ...) \
- ALTERNATIVE_CFG old_c
-
-#define _ALTERNATIVE_CFG_2(old_c, ...) \
- ALTERNATIVE_CFG old_c
+#define __ALTERNATIVE_CFG(old_c, ...) ALTERNATIVE_CFG old_c
+#define __ALTERNATIVE_CFG_2(old_c, ...) ALTERNATIVE_CFG old_c
#else /* !__ASSEMBLY__ */
-#define __ALTERNATIVE_CFG(old_c) \
- old_c "\n"
+#define __ALTERNATIVE_CFG(old_c, ...) old_c "\n"
+#define __ALTERNATIVE_CFG_2(old_c, ...) old_c "\n"
-#define _ALTERNATIVE_CFG(old_c, ...) \
- __ALTERNATIVE_CFG(old_c)
+#endif /* __ASSEMBLY__ */
-#define _ALTERNATIVE_CFG_2(old_c, ...) \
- __ALTERNATIVE_CFG(old_c)
+#define _ALTERNATIVE_CFG(old_c, ...) __ALTERNATIVE_CFG(old_c)
+#define _ALTERNATIVE_CFG_2(old_c, ...) __ALTERNATIVE_CFG_2(old_c)
-#endif /* __ASSEMBLY__ */
#endif /* CONFIG_RISCV_ALTERNATIVE */
/*
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] riscv: Provide all alternative macros all the time
2025-04-14 12:09 [PATCH] riscv: Provide all alternative macros all the time Andrew Jones
@ 2025-04-14 13:05 ` Alexandre Ghiti
2025-04-16 18:42 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Ghiti @ 2025-04-14 13:05 UTC (permalink / raw)
To: Andrew Jones, linux-riscv, linux-kernel
Cc: paul.walmsley, palmer, conor.dooley, oe-kbuild-all, charlie,
samuel.holland, kernel test robot
Hi Drew,
On 14/04/2025 14:09, Andrew Jones wrote:
> 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>
> ---
> arch/riscv/include/asm/alternative-macros.h | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
> index 721ec275ce57..231d777d936c 100644
> --- a/arch/riscv/include/asm/alternative-macros.h
> +++ b/arch/riscv/include/asm/alternative-macros.h
> @@ -115,24 +115,19 @@
> \old_c
> .endm
>
> -#define _ALTERNATIVE_CFG(old_c, ...) \
> - ALTERNATIVE_CFG old_c
> -
> -#define _ALTERNATIVE_CFG_2(old_c, ...) \
> - ALTERNATIVE_CFG old_c
> +#define __ALTERNATIVE_CFG(old_c, ...) ALTERNATIVE_CFG old_c
> +#define __ALTERNATIVE_CFG_2(old_c, ...) ALTERNATIVE_CFG old_c
>
> #else /* !__ASSEMBLY__ */
>
> -#define __ALTERNATIVE_CFG(old_c) \
> - old_c "\n"
> +#define __ALTERNATIVE_CFG(old_c, ...) old_c "\n"
> +#define __ALTERNATIVE_CFG_2(old_c, ...) old_c "\n"
>
> -#define _ALTERNATIVE_CFG(old_c, ...) \
> - __ALTERNATIVE_CFG(old_c)
> +#endif /* __ASSEMBLY__ */
>
> -#define _ALTERNATIVE_CFG_2(old_c, ...) \
> - __ALTERNATIVE_CFG(old_c)
> +#define _ALTERNATIVE_CFG(old_c, ...) __ALTERNATIVE_CFG(old_c)
> +#define _ALTERNATIVE_CFG_2(old_c, ...) __ALTERNATIVE_CFG_2(old_c)
>
> -#endif /* __ASSEMBLY__ */
> #endif /* CONFIG_RISCV_ALTERNATIVE */
>
> /*
I could not find the right Fixes tag, so unless you have one, I'll add
the commit pointed at by kernel test robot.
You can add:
Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks for looking into this!
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] riscv: Provide all alternative macros all the time
2025-04-14 12:09 [PATCH] riscv: Provide all alternative macros all the time Andrew Jones
2025-04-14 13:05 ` Alexandre Ghiti
@ 2025-04-16 18:42 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-04-16 18:42 UTC (permalink / raw)
To: Andrew Jones
Cc: linux-riscv, linux-kernel, paul.walmsley, palmer, alex,
conor.dooley, oe-kbuild-all, charlie, samuel.holland, lkp
Hello:
This patch was applied to riscv/linux.git (fixes)
by Alexandre Ghiti <alexghiti@rivosinc.com>:
On Mon, 14 Apr 2025 14:09:48 +0200 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- riscv: Provide all alternative macros all the time
https://git.kernel.org/riscv/c/fb53a9aa5f5b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-16 18:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14 12:09 [PATCH] riscv: Provide all alternative macros all the time Andrew Jones
2025-04-14 13:05 ` Alexandre Ghiti
2025-04-16 18:42 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox