Re: [PATCH v2 1/3] panic: Introduce arch_do_panic
From: Mete Durlu
Date: Tue Jul 28 2026 - 06:23:29 EST
On 27/07/2026 14:59, Bradley Morgan wrote:
Hi Mete,
Hi Bradley,
+#ifndef arch_do_panic
+#define arch_do_panic arch_do_panic
+static inline void arch_do_panic(void) {}
+#endif
this is fragile. the arch override only kicks in if whatever header
defines the macro happens to be in panic.c's include chain. if it ever
falls out, the empty stub wins silently, the arch version still
compiles as a global nobody calls, and the hook is just dead. no build
break, no warning, nothing.
use a weak function instead.
While I acknowledge the benefits you just listed, I got the
notion that maintainers don't prefer __weak implementations
and instead opt for arch specific override via ifndef guards.
Therefore I wanted to start with this approach.
However I am willing to switch if the maintainers would favor
that approach.
one more thing on the call site: arch code now runs (and prints, on
sparc) after the "end Kernel panic" marker, which until now was the
last line anyone would ever see. tools grep for that as a terminal
marker. probably fine, but say so in the changelog instead of leaving
it implicit.
Right, I'll mention that. And by changelog I take it that you mean
the commit message, right?
s/already has/already have/ in the changelog while your at it.
Thanks, I'll fix the typo in the next version.