From 02fa646a373aedaf43b946169ccbe31e82d265b5 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Wed, 15 Sep 2021 13:58:48 +0200 Subject: [PATCH] DEV: coccinelle: Add bug_on.cocci This replaces an if + ABORT_NOW() by BUG_ON(). It might change behavior, because BUG_ON will result in a no-op if not enabled. --- dev/coccinelle/bug_on.cocci | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 dev/coccinelle/bug_on.cocci diff --git a/dev/coccinelle/bug_on.cocci b/dev/coccinelle/bug_on.cocci new file mode 100644 index 000000000..38378794d --- /dev/null +++ b/dev/coccinelle/bug_on.cocci @@ -0,0 +1,7 @@ +@@ +expression E; +@@ + +- if (E) +- ABORT_NOW(); ++ BUG_ON(E);