// using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, INRIA, DIKU. GPLv2. // URL: https://coccinelle.gitlabpages.inria.fr/website/rules/bugon.html // Options: @ disable unlikely @ expression E,E1,E2,f; @@ ( if (unlikely(<+... \(f(...)\|++E1\|--E1\|E1++\|E1--\|E1=E2\) ...+>)) { BUG(); } | - if (unlikely(E)) { BUG(); } + BUG_ON(E); ) @@ expression E,E1,E2,f; @@ ( if (<+... \(f(...)\|++E1\|--E1\|E1++\|E1--\|E1=E2\) ...+>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); )