OXIESEC PANEL
- Current Dir:
/
/
usr
/
src
/
linux-headers-4.15.0-213
/
scripts
/
coccinelle
/
misc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2024 07:14:16 AM
rwxr-xr-x
📄
array_size.cocci
1.66 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
badty.cocci
1.68 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
boolconv.cocci
1.44 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
boolinit.cocci
2.2 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
boolreturn.cocci
698 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
bugon.cocci
1.45 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cond_no_effect.cocci
2.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cstptr.cocci
827 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
doubleinit.cocci
1.36 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ifaddr.cocci
659 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
ifcol.cocci
1.21 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
irqf_oneshot.cocci
1.91 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
noderef.cocci
1.17 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
of_table.cocci
1.33 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
orplus.cocci
1 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
returnvar.cocci
1.22 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
semicolon.cocci
1.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
warn.cocci
1.62 KB
01/28/2018 09:20:33 PM
rw-r--r--
Editing: bugon.cocci
Close
/// Use BUG_ON instead of a if condition followed by BUG. /// //# This makes an effort to find cases where BUG() follows an if //# condition on an expression and replaces the if condition and BUG() //# with a BUG_ON having the conditional expression of the if statement //# as argument. // // Confidence: High // Copyright: (C) 2014 Himangi Saraogi. GPLv2. // Comments: // Options: --no-includes --include-headers virtual patch virtual context virtual org virtual report //---------------------------------------------------------- // For context mode //---------------------------------------------------------- @depends on context@ expression e; @@ *if (e) BUG(); //---------------------------------------------------------- // For patch mode //---------------------------------------------------------- @depends on patch@ expression e; @@ -if (e) BUG(); +BUG_ON(e); //---------------------------------------------------------- // For org and report mode //---------------------------------------------------------- @r depends on (org || report)@ expression e; position p; @@ if (e) BUG@p (); @script:python depends on org@ p << r.p; @@ coccilib.org.print_todo(p[0], "WARNING use BUG_ON") @script:python depends on report@ p << r.p; @@ msg="WARNING: Use BUG_ON instead of if condition followed by BUG.\nPlease make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)" coccilib.report.print_report(p[0], msg)