summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/scripts/coccinelle/misc
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 12:28:04 +0530
committerSrikant Patnaik2015-01-11 12:28:04 +0530
commit871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch)
tree8718f573808810c2a1e8cb8fb6ac469093ca2784 /ANDROID_3.4.5/scripts/coccinelle/misc
parent9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff)
downloadFOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure.
Diffstat (limited to 'ANDROID_3.4.5/scripts/coccinelle/misc')
-rw-r--r--ANDROID_3.4.5/scripts/coccinelle/misc/boolinit.cocci178
-rw-r--r--ANDROID_3.4.5/scripts/coccinelle/misc/cstptr.cocci41
-rw-r--r--ANDROID_3.4.5/scripts/coccinelle/misc/doubleinit.cocci53
-rw-r--r--ANDROID_3.4.5/scripts/coccinelle/misc/ifcol.cocci48
4 files changed, 0 insertions, 320 deletions
diff --git a/ANDROID_3.4.5/scripts/coccinelle/misc/boolinit.cocci b/ANDROID_3.4.5/scripts/coccinelle/misc/boolinit.cocci
deleted file mode 100644
index 97ce41ce..00000000
--- a/ANDROID_3.4.5/scripts/coccinelle/misc/boolinit.cocci
+++ /dev/null
@@ -1,178 +0,0 @@
-/// Bool initializations should use true and false. Bool tests don't need
-/// comparisons. Based on contributions from Joe Perches, Rusty Russell
-/// and Bruce W Allan.
-///
-// Confidence: High
-// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Options: -include_headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
-@depends on patch@
-bool t;
-symbol true;
-symbol false;
-@@
-
-(
-- t == true
-+ t
-|
-- true == t
-+ t
-|
-- t != true
-+ !t
-|
-- true != t
-+ !t
-|
-- t == false
-+ !t
-|
-- false == t
-+ !t
-|
-- t != false
-+ t
-|
-- false != t
-+ t
-)
-
-@depends on patch disable is_zero, isnt_zero@
-bool t;
-@@
-
-(
-- t == 1
-+ t
-|
-- t != 1
-+ !t
-|
-- t == 0
-+ !t
-|
-- t != 0
-+ t
-)
-
-@depends on patch@
-bool b;
-@@
-(
- b =
-- 0
-+ false
-|
- b =
-- 1
-+ true
-)
-
-// ---------------------------------------------------------------------
-
-@r1 depends on !patch@
-bool t;
-position p;
-@@
-
-(
-* t@p == true
-|
-* true == t@p
-|
-* t@p != true
-|
-* true != t@p
-|
-* t@p == false
-|
-* false == t@p
-|
-* t@p != false
-|
-* false != t@p
-)
-
-@r2 depends on !patch disable is_zero, isnt_zero@
-bool t;
-position p;
-@@
-
-(
-* t@p == 1
-|
-* t@p != 1
-|
-* t@p == 0
-|
-* t@p != 0
-)
-
-@r3 depends on !patch@
-bool b;
-position p1,p2;
-constant c;
-@@
-(
-*b@p1 = 0
-|
-*b@p1 = 1
-|
-*b@p2 = c
-)
-
-@script:python depends on org@
-p << r1.p;
-@@
-
-cocci.print_main("WARNING: Comparison to bool",p)
-
-@script:python depends on org@
-p << r2.p;
-@@
-
-cocci.print_main("WARNING: Comparison of bool to 0/1",p)
-
-@script:python depends on org@
-p1 << r3.p1;
-@@
-
-cocci.print_main("WARNING: Assignment of bool to 0/1",p1)
-
-@script:python depends on org@
-p2 << r3.p2;
-@@
-
-cocci.print_main("ERROR: Assignment of bool to non-0/1 constant",p2)
-
-@script:python depends on report@
-p << r1.p;
-@@
-
-coccilib.report.print_report(p[0],"WARNING: Comparison to bool")
-
-@script:python depends on report@
-p << r2.p;
-@@
-
-coccilib.report.print_report(p[0],"WARNING: Comparison of bool to 0/1")
-
-@script:python depends on report@
-p1 << r3.p1;
-@@
-
-coccilib.report.print_report(p1[0],"WARNING: Assignment of bool to 0/1")
-
-@script:python depends on report@
-p2 << r3.p2;
-@@
-
-coccilib.report.print_report(p2[0],"ERROR: Assignment of bool to non-0/1 constant")
diff --git a/ANDROID_3.4.5/scripts/coccinelle/misc/cstptr.cocci b/ANDROID_3.4.5/scripts/coccinelle/misc/cstptr.cocci
deleted file mode 100644
index d4256448..00000000
--- a/ANDROID_3.4.5/scripts/coccinelle/misc/cstptr.cocci
+++ /dev/null
@@ -1,41 +0,0 @@
-/// PTR_ERR should be applied before its argument is reassigned, typically
-/// to NULL
-///
-// Confidence: High
-// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: -no_includes -include_headers
-
-virtual org
-virtual report
-virtual context
-
-@r exists@
-expression e,e1;
-constant c;
-position p1,p2;
-@@
-
-*e@p1 = c
-... when != e = e1
- when != &e
- when != true IS_ERR(e)
-*PTR_ERR@p2(e)
-
-@script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("PTR_ERR",p2)
-cocci.print_secs("assignment",p1)
-
-@script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "ERROR: PTR_ERR applied after initialization to constant on line %s" % (p1[0].line)
-coccilib.report.print_report(p2[0],msg)
diff --git a/ANDROID_3.4.5/scripts/coccinelle/misc/doubleinit.cocci b/ANDROID_3.4.5/scripts/coccinelle/misc/doubleinit.cocci
deleted file mode 100644
index cf74a00c..00000000
--- a/ANDROID_3.4.5/scripts/coccinelle/misc/doubleinit.cocci
+++ /dev/null
@@ -1,53 +0,0 @@
-/// Find duplicate field initializations. This has a high rate of false
-/// positives due to #ifdefs, which Coccinelle is not aware of in a structure
-/// initialization.
-///
-// Confidence: Low
-// Copyright: (C) 2010-2012 Nicolas Palix. GPLv2.
-// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2.
-// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments: requires at least Coccinelle 0.2.4, lex or parse error otherwise
-// Options: -no_includes -include_headers
-
-virtual org
-virtual report
-
-@r@
-identifier I, s, fld;
-position p0,p;
-expression E;
-@@
-
-struct I s =@p0 { ..., .fld@p = E, ...};
-
-@s@
-identifier I, s, r.fld;
-position r.p0,p;
-expression E;
-@@
-
-struct I s =@p0 { ..., .fld@p = E, ...};
-
-@script:python depends on org@
-p0 << r.p0;
-fld << r.fld;
-ps << s.p;
-pr << r.p;
-@@
-
-if int(ps[0].line) < int(pr[0].line) or (int(ps[0].line) == int(pr[0].line) and int(ps[0].column) < int(pr[0].column)):
- cocci.print_main(fld,p0)
- cocci.print_secs("s",ps)
- cocci.print_secs("r",pr)
-
-@script:python depends on report@
-p0 << r.p0;
-fld << r.fld;
-ps << s.p;
-pr << r.p;
-@@
-
-if int(ps[0].line) < int(pr[0].line) or (int(ps[0].line) == int(pr[0].line) and int(ps[0].column) < int(pr[0].column)):
- msg = "%s: first occurrence line %s, second occurrence line %s" % (fld,ps[0].line,pr[0].line)
- coccilib.report.print_report(p0[0],msg)
diff --git a/ANDROID_3.4.5/scripts/coccinelle/misc/ifcol.cocci b/ANDROID_3.4.5/scripts/coccinelle/misc/ifcol.cocci
deleted file mode 100644
index b7ed91db..00000000
--- a/ANDROID_3.4.5/scripts/coccinelle/misc/ifcol.cocci
+++ /dev/null
@@ -1,48 +0,0 @@
-/// Find confusingly indented code in or after an if. An if branch should
-/// be indented. The code following an if should not be indented.
-/// Sometimes, code after an if that is indented is actually intended to be
-/// part of the if branch.
-///
-/// This has a high rate of false positives, because Coccinelle's column
-/// calculation does not distinguish between spaces and tabs, so code that
-/// is not visually aligned may be considered to be in the same column.
-///
-// Confidence: Low
-// Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2.
-// Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2.
-// Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: -no_includes -include_headers
-
-virtual org
-virtual report
-
-@r disable braces4@
-position p1,p2;
-statement S1,S2;
-@@
-
-(
-if (...) { ... }
-|
-if (...) S1@p1 S2@p2
-)
-
-@script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-if (p1[0].column == p2[0].column):
- cocci.print_main("branch",p1)
- cocci.print_secs("after",p2)
-
-@script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-if (p1[0].column == p2[0].column):
- msg = "code aligned with following code on line %s" % (p2[0].line)
- coccilib.report.print_report(p1[0],msg)