[PATCH v5 2/4] panic: flatten nmi_panic control flow
From: Bradley Morgan
Date: Sun Jul 26 2026 - 15:05:19 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 <include@xxxxxxxxx>
---
kernel/panic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 26b91b92dd71..74065c860779 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -516,7 +516,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