Thread (42 messages) 42 messages, 4 authors, 2025-08-01

Re: [RFC PATCH v1 08/16] unwind_user: Enable archs that save RA/FP in other registers

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2025-07-17 12:10:08
Also in: bpf, lkml

On Thu, 17 Jul 2025 13:28:25 +0200
Jens Remus [off-list ref] wrote:
quoted
quoted
+	default:
+		WARN_ON_ONCE(1);
+		goto done;  
The default case will never happen, can we make it a BUG()?  
Whatever Steve and you agree on.  I am new to Kernel development.
Keep the WARN_ON(). Linus has yelled at people for using BUG() when a
WARN_ON() would do.

WARN_ON() is meant for things that should never happen. BUG() is reserved
for places in the kernel that is dangerous to continue.

It's even documented:

  https://docs.kernel.org/process/deprecated.html#bug-and-bug-on

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help