From: Tim Duesterhus Date: Wed, 15 Sep 2021 11:58:48 +0000 (+0200) Subject: DEV: coccinelle: Add bug_on.cocci X-Git-Tag: v2.5-dev8~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02fa646a373aedaf43b946169ccbe31e82d265b5;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/dev/coccinelle/bug_on.cocci b/dev/coccinelle/bug_on.cocci new file mode 100644 index 0000000000..38378794d3 --- /dev/null +++ b/dev/coccinelle/bug_on.cocci @@ -0,0 +1,7 @@ +@@ +expression E; +@@ + +- if (E) +- ABORT_NOW(); ++ BUG_ON(E);