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