riscv: extend concatenated alternatives-lines to the same length
authorHeiko Stuebner <heiko@sntech.de>
Wed, 11 May 2022 19:29:14 +0000 (21:29 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 12 May 2022 04:36:32 +0000 (21:36 -0700)
ALT_NEW_CONTENT already uses same-length assembler lines, so
extend this to the other elements as well.

This makes it more readable when these elements need to be extended
in the future.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Link: https://lore.kernel.org/r/20220511192921.2223629-6-heiko@sntech.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/alternative-macros.h

index 9e04cd5..8c2bbc7 100644 (file)
 #include <asm/asm.h>
 #include <linux/stringify.h>
 
-#define ALT_ENTRY(oldptr, newptr, vendor_id, errata_id, newlen) \
-       RISCV_PTR " " oldptr "\n" \
-       RISCV_PTR " " newptr "\n" \
-       REG_ASM " " vendor_id "\n" \
-       REG_ASM " " newlen "\n" \
+#define ALT_ENTRY(oldptr, newptr, vendor_id, errata_id, newlen)                \
+       RISCV_PTR " " oldptr "\n"                                       \
+       RISCV_PTR " " newptr "\n"                                       \
+       REG_ASM " " vendor_id "\n"                                      \
+       REG_ASM " " newlen "\n"                                         \
        ".word " errata_id "\n"
 
-#define ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) \
+#define ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c)           \
        ".if " __stringify(enable) " == 1\n"                            \
        ".pushsection .alternative, \"a\"\n"                            \
        ALT_ENTRY("886b", "888f", __stringify(vendor_id), __stringify(errata_id), "889f - 888f") \
        ".org   . - (889b - 888b) + (887b - 886b)\n"                    \
        ".endif\n"
 
-#define __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, enable) \
-       "886 :\n"       \
-       old_c "\n"      \
-       "887 :\n"       \
+#define __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, enable)  \
+       "886 :\n"                                                       \
+       old_c "\n"                                                      \
+       "887 :\n"                                                       \
        ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c)
 
 #define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \