[PATCH v4 2/3] panic: flatten nmi_panic control flow

From: Bradley Morgan

Date: Tue Jul 14 2026 - 13:31: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.

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 4b1de407a73a..c58c72d9f5a0 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -521,7 +521,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.53.0