As it seems to be rather unclear if/when to use BUG(), BUG_ON(), VM_BUG_ON(), WARN_ON_ONCE(), ... let's try to document the result of a recent discussion. Details can be found in patch #1. v1 -> v2: * "coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel")" -> Minor rephrasing / reference fix [John] -> Compile fix [Akira] * "powerpc/prom_init: drop PROM_BUG()" -> Dropped because it will go upstream via a different tree * "checkpatch: warn on usage of VM_BUG_ON() and other BUG variants" -> Rephrase warning message and remove trailing period [John+Joe] RFC -> v1: * "coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel")" -> Rephrase/extend according to John -> Add some details regarding the use of panic() * powerpc/prom_init: drop PROM_BUG() -> Added * "checkpatch: warn on usage of VM_BUG_ON() and other BUG variants" -> Warn on more variants Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: David Laight <David.Laight@xxxxxxxxxx> Cc: Jonathan Corbet <corbet@xxxxxxx> Cc: Andy Whitcroft <apw@xxxxxxxxxxxxx> Cc: Joe Perches <joe@xxxxxxxxxxx> Cc: Dwaipayan Ray <dwaipayanray1@xxxxxxxxx> Cc: Lukas Bulwahn <lukas.bulwahn@xxxxxxxxx> Cc: Baoquan He <bhe@xxxxxxxxxx> Cc: Vivek Goyal <vgoyal@xxxxxxxxxx> Cc: Dave Young <dyoung@xxxxxxxxxx> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Nicholas Piggin <npiggin@xxxxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Cc: Akira Yokosawa <akiyks@xxxxxxxxx> Cc: Kalle Valo <kvalo@xxxxxxxxxx> Cc: Daniel K. <daniel@xxxxxxxxxx> David Hildenbrand (2): coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") checkpatch: warn on usage of VM_BUG_ON() and other BUG variants Documentation/process/coding-style.rst | 62 ++++++++++++++++++++++++++ scripts/checkpatch.pl | 6 +-- 2 files changed, 65 insertions(+), 3 deletions(-) -- 2.37.3