[PATCH v1 0/3] coding-style.rst: document BUG() and WARN() rules

From: David Hildenbrand
Date: Tue Sep 20 2022 - 08:23:22 EST


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.

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>

David Hildenbrand (3):
coding-style.rst: document BUG() and WARN() rules ("do not crash the
kernel")
powerpc/prom_init: drop PROM_BUG()
checkpatch: warn on usage of VM_BUG_ON() and other BUG variants

Documentation/process/coding-style.rst | 61 ++++++++++++++++++++++++++
arch/powerpc/kernel/prom_init.c | 6 ---
scripts/checkpatch.pl | 6 +--
3 files changed, 64 insertions(+), 9 deletions(-)

--
2.37.3