/// Check for constants that are added but are used elsewhere as bitmasks /// The results should be checked manually to ensure that the nonzero /// bits in the two constants are actually disjoint. /// // Confidence: Moderate // Copyright: (C) 2013 Julia Lawall, INRIA/LIP6. GPLv2. // Copyright: (C) 2013 Gilles Muller, INRIA/LIP6. GPLv2. // URL: http://coccinelle.lip6.fr/ // Comments: // Options: --no-includes --include-headers virtual org virtual report virtual context @r@ constant c,c1; identifier i,i1; position p; @@ ( c1 + c - 1 | c1@i1 +@p c@i ) @s@ constant r.c, r.c1; identifier i; expression e; @@ ( e | c@i | e & c@i | e |= c@i | e &= c@i | e | c1@i | e & c1@i | e |= c1@i | e &= c1@i ) @depends on s@ position r.p; constant c1,c2; @@ * c1 +@p c2 @script:python depends on s && org@ p << r.p; @@ cocci.print_main("sum of probable bitmasks, consider |",p) @script:python depends on s && report@ p << r.p; @@ msg = "WARNING: sum of probable bitmasks, consider |" coccilib.report.print_report(p[0],msg)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
array_size.cocci | File | 1.66 KB | 0644 |
|
badty.cocci | File | 1.68 KB | 0644 |
|
boolconv.cocci | File | 1.44 KB | 0644 |
|
boolinit.cocci | File | 2.2 KB | 0644 |
|
boolreturn.cocci | File | 698 B | 0644 |
|
bugon.cocci | File | 1.45 KB | 0644 |
|
cond_no_effect.cocci | File | 2.04 KB | 0644 |
|
cstptr.cocci | File | 827 B | 0644 |
|
doubleinit.cocci | File | 1.36 KB | 0644 |
|
ifaddr.cocci | File | 659 B | 0644 |
|
ifcol.cocci | File | 1.21 KB | 0644 |
|
irqf_oneshot.cocci | File | 1.91 KB | 0644 |
|
noderef.cocci | File | 1.17 KB | 0644 |
|
of_table.cocci | File | 1.33 KB | 0644 |
|
orplus.cocci | File | 1 KB | 0644 |
|
returnvar.cocci | File | 1.22 KB | 0644 |
|
semicolon.cocci | File | 1.04 KB | 0644 |
|
warn.cocci | File | 1.62 KB | 0644 |
|