]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS()
authorIngo Molnar <mingo@kernel.org>
Thu, 15 May 2025 12:46:40 +0000 (14:46 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 28 Jul 2025 06:05:49 +0000 (08:05 +0200)
Pass in the condition string from __WARN_FLAGS() to __BUG_FLAGS(),
but don't use it yet.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org> # Rebased ancestor commits
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Link: https://lore.kernel.org/r/20250515124644.2958810-12-mingo@kernel.org
arch/riscv/include/asm/bug.h

index b22ee4d2c882afe88f76a6c9a6525a899ba0c330..feaf456d465beb2356a9802a4ccbb3bb7dd50f00 100644 (file)
@@ -50,7 +50,7 @@ typedef u32 bug_insn_t;
 #endif
 
 #ifdef CONFIG_GENERIC_BUG
-#define __BUG_FLAGS(flags)                                     \
+#define __BUG_FLAGS(cond_str, flags)                           \
 do {                                                           \
        __asm__ __volatile__ (                                  \
                "1:\n\t"                                        \
@@ -66,17 +66,17 @@ do {                                                                \
                  "i" (sizeof(struct bug_entry)));              \
 } while (0)
 #else /* CONFIG_GENERIC_BUG */
-#define __BUG_FLAGS(flags) do {                                        \
+#define __BUG_FLAGS(cond_str, flags) do {                      \
        __asm__ __volatile__ ("ebreak\n");                      \
 } while (0)
 #endif /* CONFIG_GENERIC_BUG */
 
 #define BUG() do {                                             \
-       __BUG_FLAGS(0);                                         \
+       __BUG_FLAGS("", 0);                                     \
        unreachable();                                          \
 } while (0)
 
-#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
+#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(cond_str, BUGFLAG_WARNING|(flags))
 
 #define HAVE_ARCH_BUG