[PATCH v7 2/6] panic: flatten nmi_panic control flow
From: Bradley Morgan
Date: Wed Sep 16 2026 - 14:33:24 EST
panic() is __noreturn, so the else after panic_try_start() is dead.
Drop it so the force_cpu path can be added cleanly on top.
Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
Signed-off-by: Bradley Morgan <brads@xxxxxxxxxxxxxx>
---
kernel/panic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 08072bfae422..5646d4fb82b7 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -517,7 +517,8 @@ void nmi_panic(struct pt_regs *regs, const char *msg)
{
if (panic_try_start())
panic("%s", msg);
- else if (panic_on_other_cpu())
+
+ if (panic_on_other_cpu())
nmi_panic_self_stop(regs);
}
EXPORT_SYMBOL(nmi_panic);
--
2.47.3