[PATCH 09/11] coccinelle: remove own copies of the scripts

Artem Bityutskiy dedekind1 at gmail.com
Fri Feb 7 07:28:22 PST 2014


From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>

Now we do not need them since we use the scripts from the kernel tree instead.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
---
 .../coccinelle/api/alloc/drop_kmalloc_cast.cocci   |  67 -----
 helpers/coccinelle/api/alloc/kzalloc-simple.cocci  |  86 -------
 helpers/coccinelle/api/d_find_alias.cocci          |  80 ------
 helpers/coccinelle/api/devm_ioremap_resource.cocci |  90 -------
 .../coccinelle/api/devm_request_and_ioremap.cocci  | 105 --------
 helpers/coccinelle/api/err_cast.cocci              |  56 ----
 helpers/coccinelle/api/kstrdup.cocci               | 104 --------
 helpers/coccinelle/api/memdup.cocci                |  66 -----
 helpers/coccinelle/api/memdup_user.cocci           |  60 -----
 helpers/coccinelle/api/ptr_ret.cocci               |  96 -------
 helpers/coccinelle/api/resource_size.cocci         |  93 -------
 helpers/coccinelle/api/simple_open.cocci           |  70 -----
 helpers/coccinelle/free/clk_put.cocci              |  67 -----
 helpers/coccinelle/free/devm_free.cocci            |  71 ------
 helpers/coccinelle/free/iounmap.cocci              |  67 -----
 helpers/coccinelle/free/kfree.cocci                | 121 ---------
 helpers/coccinelle/free/kfreeaddr.cocci            |  32 ---
 helpers/coccinelle/free/pci_free_consistent.cocci  |  52 ----
 helpers/coccinelle/iterators/fen.cocci             | 123 ---------
 helpers/coccinelle/iterators/itnull.cocci          |  94 -------
 .../coccinelle/iterators/list_entry_update.cocci   |  62 -----
 helpers/coccinelle/iterators/use_after_iter.cocci  | 147 -----------
 helpers/coccinelle/locks/call_kern.cocci           | 105 --------
 helpers/coccinelle/locks/double_lock.cocci         |  92 -------
 helpers/coccinelle/locks/flags.cocci               |  80 ------
 helpers/coccinelle/locks/mini_lock.cocci           |  96 -------
 helpers/coccinelle/misc/boolinit.cocci             | 178 -------------
 helpers/coccinelle/misc/boolreturn.cocci           |  58 -----
 helpers/coccinelle/misc/cstptr.cocci               |  41 ---
 helpers/coccinelle/misc/doubleinit.cocci           |  53 ----
 helpers/coccinelle/misc/ifaddr.cocci               |  35 ---
 helpers/coccinelle/misc/ifcol.cocci                |  48 ----
 helpers/coccinelle/misc/irqf_oneshot.cocci         |  65 -----
 helpers/coccinelle/misc/memcpy-assign.cocci        | 103 --------
 helpers/coccinelle/misc/noderef.cocci              |  65 -----
 helpers/coccinelle/misc/orplus.cocci               |  55 ----
 helpers/coccinelle/misc/semicolon.cocci            |  83 ------
 helpers/coccinelle/misc/warn.cocci                 | 109 --------
 helpers/coccinelle/null/badzero.cocci              | 237 -----------------
 helpers/coccinelle/null/deref_null.cocci           | 282 ---------------------
 helpers/coccinelle/null/eno.cocci                  |  48 ----
 helpers/coccinelle/null/kmerr.cocci                |  72 ------
 helpers/coccinelle/tests/doublebitand.cocci        |  54 ----
 helpers/coccinelle/tests/doubletest.cocci          |  40 ---
 helpers/coccinelle/tests/odd_ptr_err.cocci         |  65 -----
 45 files changed, 3873 deletions(-)
 delete mode 100644 helpers/coccinelle/api/alloc/drop_kmalloc_cast.cocci
 delete mode 100644 helpers/coccinelle/api/alloc/kzalloc-simple.cocci
 delete mode 100644 helpers/coccinelle/api/d_find_alias.cocci
 delete mode 100644 helpers/coccinelle/api/devm_ioremap_resource.cocci
 delete mode 100644 helpers/coccinelle/api/devm_request_and_ioremap.cocci
 delete mode 100644 helpers/coccinelle/api/err_cast.cocci
 delete mode 100644 helpers/coccinelle/api/kstrdup.cocci
 delete mode 100644 helpers/coccinelle/api/memdup.cocci
 delete mode 100644 helpers/coccinelle/api/memdup_user.cocci
 delete mode 100644 helpers/coccinelle/api/ptr_ret.cocci
 delete mode 100644 helpers/coccinelle/api/resource_size.cocci
 delete mode 100644 helpers/coccinelle/api/simple_open.cocci
 delete mode 100644 helpers/coccinelle/free/clk_put.cocci
 delete mode 100644 helpers/coccinelle/free/devm_free.cocci
 delete mode 100644 helpers/coccinelle/free/iounmap.cocci
 delete mode 100644 helpers/coccinelle/free/kfree.cocci
 delete mode 100644 helpers/coccinelle/free/kfreeaddr.cocci
 delete mode 100644 helpers/coccinelle/free/pci_free_consistent.cocci
 delete mode 100644 helpers/coccinelle/iterators/fen.cocci
 delete mode 100644 helpers/coccinelle/iterators/itnull.cocci
 delete mode 100644 helpers/coccinelle/iterators/list_entry_update.cocci
 delete mode 100644 helpers/coccinelle/iterators/use_after_iter.cocci
 delete mode 100644 helpers/coccinelle/locks/call_kern.cocci
 delete mode 100644 helpers/coccinelle/locks/double_lock.cocci
 delete mode 100644 helpers/coccinelle/locks/flags.cocci
 delete mode 100644 helpers/coccinelle/locks/mini_lock.cocci
 delete mode 100644 helpers/coccinelle/misc/boolinit.cocci
 delete mode 100644 helpers/coccinelle/misc/boolreturn.cocci
 delete mode 100644 helpers/coccinelle/misc/cstptr.cocci
 delete mode 100644 helpers/coccinelle/misc/doubleinit.cocci
 delete mode 100644 helpers/coccinelle/misc/ifaddr.cocci
 delete mode 100644 helpers/coccinelle/misc/ifcol.cocci
 delete mode 100644 helpers/coccinelle/misc/irqf_oneshot.cocci
 delete mode 100644 helpers/coccinelle/misc/memcpy-assign.cocci
 delete mode 100644 helpers/coccinelle/misc/noderef.cocci
 delete mode 100644 helpers/coccinelle/misc/orplus.cocci
 delete mode 100644 helpers/coccinelle/misc/semicolon.cocci
 delete mode 100644 helpers/coccinelle/misc/warn.cocci
 delete mode 100644 helpers/coccinelle/null/badzero.cocci
 delete mode 100644 helpers/coccinelle/null/deref_null.cocci
 delete mode 100644 helpers/coccinelle/null/eno.cocci
 delete mode 100644 helpers/coccinelle/null/kmerr.cocci
 delete mode 100644 helpers/coccinelle/tests/doublebitand.cocci
 delete mode 100644 helpers/coccinelle/tests/doubletest.cocci
 delete mode 100644 helpers/coccinelle/tests/odd_ptr_err.cocci

diff --git a/helpers/coccinelle/api/alloc/drop_kmalloc_cast.cocci b/helpers/coccinelle/api/alloc/drop_kmalloc_cast.cocci
deleted file mode 100644
index bd5d08b..0000000
--- a/helpers/coccinelle/api/alloc/drop_kmalloc_cast.cocci
+++ /dev/null
@@ -1,67 +0,0 @@
-///
-/// Casting (void *) value returned by kmalloc is useless
-/// as mentioned in Documentation/CodingStyle, Chap 14.
-///
-// Confidence: High
-// Copyright: 2009,2010 Nicolas Palix, DIKU.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Options: --no-includes --include-headers
-//
-// Keywords: kmalloc, kzalloc, kcalloc
-// Version min: < 2.6.12 kmalloc
-// Version min: < 2.6.12 kcalloc
-// Version min:   2.6.14 kzalloc
-//
-
-virtual context
-virtual patch
-virtual org
-virtual report
-
-//----------------------------------------------------------
-//  For context mode
-//----------------------------------------------------------
-
- at depends on context@
-type T;
-@@
-
-* (T *)
-  \(kmalloc\|kzalloc\|kcalloc\)(...)
-
-//----------------------------------------------------------
-//  For patch mode
-//----------------------------------------------------------
-
- at depends on patch@
-type T;
-@@
-
-- (T *)
-  \(kmalloc\|kzalloc\|kcalloc\)(...)
-
-//----------------------------------------------------------
-//  For org and report mode
-//----------------------------------------------------------
-
- at r depends on org || report@
-type T;
-position p;
-@@
-
- (T at p *)\(kmalloc\|kzalloc\|kcalloc\)(...)
-
- at script:python depends on org@
-p << r.p;
-t << r.T;
-@@
-
-coccilib.org.print_safe_todo(p[0], t)
-
- at script:python depends on report@
-p << r.p;
-t << r.T;
-@@
-
-msg="WARNING: casting value returned by k[cmz]alloc to (%s *) is useless." % (t)
-coccilib.report.print_report(p[0], msg)
diff --git a/helpers/coccinelle/api/alloc/kzalloc-simple.cocci b/helpers/coccinelle/api/alloc/kzalloc-simple.cocci
deleted file mode 100644
index 52c55e4..0000000
--- a/helpers/coccinelle/api/alloc/kzalloc-simple.cocci
+++ /dev/null
@@ -1,86 +0,0 @@
-///
-/// Use kzalloc rather than kmalloc followed by memset with 0
-///
-/// This considers some simple cases that are common and easy to validate
-/// Note in particular that there are no ...s in the rule, so all of the
-/// matched code has to be contiguous
-///
-// Confidence: High
-// Copyright: (C) 2009-2010 Julia Lawall, Nicolas Palix, DIKU.  GPLv2.
-// Copyright: (C) 2009-2010 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/rules/kzalloc.html
-// Options: --no-includes --include-headers
-//
-// Keywords: kmalloc, kzalloc
-// Version min: < 2.6.12 kmalloc
-// Version min:   2.6.14 kzalloc
-//
-
-virtual context
-virtual patch
-virtual org
-virtual report
-
-//----------------------------------------------------------
-//  For context mode
-//----------------------------------------------------------
-
- at depends on context@
-type T, T2;
-expression x;
-expression E1,E2;
-statement S;
-@@
-
-* x = (T)kmalloc(E1,E2);
-  if ((x==NULL) || ...) S
-* memset((T2)x,0,E1);
-
-//----------------------------------------------------------
-//  For patch mode
-//----------------------------------------------------------
-
- at depends on patch@
-type T, T2;
-expression x;
-expression E1,E2;
-statement S;
-@@
-
-- x = (T)kmalloc(E1,E2);
-+ x = kzalloc(E1,E2);
-  if ((x==NULL) || ...) S
-- memset((T2)x,0,E1);
-
-//----------------------------------------------------------
-//  For org mode
-//----------------------------------------------------------
-
- at r depends on org || report@
-type T, T2;
-expression x;
-expression E1,E2;
-statement S;
-position p;
-@@
-
- x = (T)kmalloc at p(E1,E2);
- if ((x==NULL) || ...) S
- memset((T2)x,0,E1);
-
- at script:python depends on org@
-p << r.p;
-x << r.x;
-@@
-
-msg="%s" % (x)
-msg_safe=msg.replace("[","@(").replace("]",")")
-coccilib.org.print_todo(p[0], msg_safe)
-
- at script:python depends on report@
-p << r.p;
-x << r.x;
-@@
-
-msg="WARNING: kzalloc should be used for %s, instead of kmalloc/memset" % (x)
-coccilib.report.print_report(p[0], msg)
diff --git a/helpers/coccinelle/api/d_find_alias.cocci b/helpers/coccinelle/api/d_find_alias.cocci
deleted file mode 100644
index 9594c9f..0000000
--- a/helpers/coccinelle/api/d_find_alias.cocci
+++ /dev/null
@@ -1,80 +0,0 @@
-/// Make sure calls to d_find_alias() have a corresponding call to dput().
-//
-// Keywords: d_find_alias, dput
-//
-// Confidence: Moderate
-// URL: http://coccinelle.lip6.fr/
-// Options: --include-headers
-
-virtual context
-virtual org
-virtual patch
-virtual report
-
- at r exists@
-local idexpression struct dentry *dent;
-expression E, E1;
-statement S1, S2;
-position p1, p2;
-@@
-(
-	if (!(dent at p1 = d_find_alias(...))) S1
-|
-	dent at p1 = d_find_alias(...)
-)
-
-<...when != dput(dent)
-    when != if (...) { <+... dput(dent) ...+> }
-    when != true !dent || ...
-    when != dent = E
-    when != E = dent
-if (!dent || ...) S2
-...>
-(
-	return <+...dent...+>;
-|
-	return @p2 ...;
-|
-	dent at p2 = E1;
-|
-	E1 = dent;
-)
-
- at depends on context@
-local idexpression struct dentry *r.dent;
-position r.p1,r.p2;
-@@
-* dent at p1 = ...
-  ...
-(
-* return at p2 ...;
-|
-* dent at p2
-)
-
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-cocci.print_main("Missing call to dput()",p1)
-cocci.print_secs("",p2)
-
- at depends on patch@
-local idexpression struct dentry *r.dent;
-position r.p2;
-@@
-(
-+ dput(dent);
-  return @p2 ...;
-|
-+ dput(dent);
-  dent at p2 = ...;
-)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-msg = "Missing call to dput() at line %s."
-coccilib.report.print_report(p1[0], msg % (p2[0].line))
diff --git a/helpers/coccinelle/api/devm_ioremap_resource.cocci b/helpers/coccinelle/api/devm_ioremap_resource.cocci
deleted file mode 100644
index 495daa3..0000000
--- a/helpers/coccinelle/api/devm_ioremap_resource.cocci
+++ /dev/null
@@ -1,90 +0,0 @@
-virtual patch
-virtual report
-
- at depends on patch@
-expression base, dev, res;
-@@
-
--base = devm_request_and_ioremap(dev, res);
-+base = devm_ioremap_resource(dev, res);
- ...
- if (
--base == NULL
-+IS_ERR(base)
- || ...) {
-<...
--	return ...;
-+	return PTR_ERR(base);
-...>
- }
-
- at depends on patch@
-expression e, E, ret;
-identifier l;
-@@
-
- e = devm_ioremap_resource(...);
- ...
- if (IS_ERR(e) || ...) {
- 	... when any
--	ret = E;
-+	ret = PTR_ERR(e);
- 	...
-(
- 	return ret;
-|
- 	goto l;
-)
- }
-
- at depends on patch@
-expression e;
-@@
-
- e = devm_ioremap_resource(...);
- ...
- if (IS_ERR(e) || ...) {
- 	...
--	\(dev_dbg\|dev_err\|pr_debug\|pr_err\|DRM_ERROR\)(...);
- 	...
- }
-
- at depends on patch@
-expression e;
-identifier l;
-@@
-
- e = devm_ioremap_resource(...);
- ...
- if (IS_ERR(e) || ...)
--{
-(
- 	return ...;
-|
- 	goto l;
-)
--}
-
- at r depends on report@
-expression e;
-identifier l;
-position p1;
-@@
-
-*e = devm_request_and_ioremap at p1(...);
- ...
- if (e == NULL || ...) {
- 	...
-(
- 	return ...;
-|
- 	goto l;
-)
- }
-
- at script:python depends on r@
-p1 << r.p1;
-@@
-
-msg = "ERROR: deprecated devm_request_and_ioremap() API used on line %s" % (p1[0].line)
-coccilib.report.print_report(p1[0], msg)
diff --git a/helpers/coccinelle/api/devm_request_and_ioremap.cocci b/helpers/coccinelle/api/devm_request_and_ioremap.cocci
deleted file mode 100644
index 46beb81..0000000
--- a/helpers/coccinelle/api/devm_request_and_ioremap.cocci
+++ /dev/null
@@ -1,105 +0,0 @@
-/// Reimplement a call to devm_request_mem_region followed by a call to ioremap
-/// or ioremap_nocache by a call to devm_request_and_ioremap.
-/// Devm_request_and_ioremap was introduced in
-/// 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0.  It makes the code much more
-/// concise.
-///
-///
-// Confidence: High
-// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6.  GPLv2.
-// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: -no_includes -include_headers
-
-virtual patch
-virtual org
-virtual report
-virtual context
-
- at nm@
-expression myname;
-identifier i;
-@@
-
-struct platform_driver i = { .driver = { .name = myname } };
-
- at depends on patch@
-expression dev,res,size;
-@@
-
--if (!devm_request_mem_region(dev, res->start, size,
--                              \(res->name\|dev_name(dev)\))) {
--   ...
--   return ...;
--}
-... when != res->start
-(
--devm_ioremap(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-|
--devm_ioremap_nocache(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-)
-... when any
-    when != res->start
-
-// this rule is separate from the previous one, because a single file can
-// have multiple values of myname
- at depends on patch@
-expression dev,res,size;
-expression nm.myname;
-@@
-
--if (!devm_request_mem_region(dev, res->start, size,myname)) {
--   ...
--   return ...;
--}
-... when != res->start
-(
--devm_ioremap(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-|
--devm_ioremap_nocache(dev,res->start,size)
-+devm_request_and_ioremap(dev,res)
-)
-... when any
-    when != res->start
-
-
- at pb depends on org || report || context@
-expression dev,res,size;
-expression nm.myname;
-position p1,p2;
-@@
-
-*if
-  (!devm_request_mem_region at p1(dev, res->start, size,
-                              \(res->name\|dev_name(dev)\|myname\))) {
-   ...
-   return ...;
-}
-... when != res->start
-(
-*devm_ioremap at p2(dev,res->start,size)
-|
-*devm_ioremap_nocache at p2(dev,res->start,size)
-)
-... when any
-    when != res->start
-
- at script:python depends on org@
-p1 << pb.p1;
-p2 << pb.p2;
-@@
-
-cocci.print_main("INFO: replace by devm_request_and_ioremap",p1)
-cocci.print_secs("",p2)
-
- at script:python depends on report@
-p1 << pb.p1;
-p2 << pb.p2;
-@@
-
-msg = "INFO: devm_request_mem_region followed by ioremap on line %s can be replaced by devm_request_and_ioremap" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
diff --git a/helpers/coccinelle/api/err_cast.cocci b/helpers/coccinelle/api/err_cast.cocci
deleted file mode 100644
index 2ce1150..0000000
--- a/helpers/coccinelle/api/err_cast.cocci
+++ /dev/null
@@ -1,56 +0,0 @@
-///
-/// Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
-///
-// Confidence: High
-// Copyright: (C) 2009, 2010 Nicolas Palix, DIKU.  GPLv2.
-// Copyright: (C) 2009, 2010 Julia Lawall, DIKU.  GPLv2.
-// Copyright: (C) 2009, 2010 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Options:
-//
-// Keywords: ERR_PTR, PTR_ERR, ERR_CAST
-// Version min: 2.6.25
-//
-
-virtual context
-virtual patch
-virtual org
-virtual report
-
-
-@ depends on context && !patch && !org && !report@
-expression x;
-@@
-
-* ERR_PTR(PTR_ERR(x))
-
-@ depends on !context && patch && !org && !report @
-expression x;
-@@
-
-- ERR_PTR(PTR_ERR(x))
-+ ERR_CAST(x)
-
- at r depends on !context && !patch && (org || report)@
-expression x;
-position p;
-@@
-
- ERR_PTR at p(PTR_ERR(x))
-
- at script:python depends on org@
-p << r.p;
-x << r.x;
-@@
-
-msg="WARNING ERR_CAST can be used with %s" % (x)
-msg_safe=msg.replace("[","@(").replace("]",")")
-coccilib.org.print_todo(p[0], msg_safe)
-
- at script:python depends on report@
-p << r.p;
-x << r.x;
-@@
-
-msg="WARNING: ERR_CAST can be used with %s" % (x)
-coccilib.report.print_report(p[0], msg)
diff --git a/helpers/coccinelle/api/kstrdup.cocci b/helpers/coccinelle/api/kstrdup.cocci
deleted file mode 100644
index 09cba54..0000000
--- a/helpers/coccinelle/api/kstrdup.cocci
+++ /dev/null
@@ -1,104 +0,0 @@
-/// Use kstrdup rather than duplicating its implementation
-///
-// Confidence: High
-// 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:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at depends on patch@
-expression from,to;
-expression flag,E1,E2;
-statement S;
-@@
-
--  to = kmalloc(strlen(from) + 1,flag);
-+  to = kstrdup(from, flag);
-   ... when != \(from = E1 \| to = E1 \)
-   if (to==NULL || ...) S
-   ... when != \(from = E2 \| to = E2 \)
--  strcpy(to, from);
-
- at depends on patch@
-expression x,from,to;
-expression flag,E1,E2,E3;
-statement S;
-@@
-
--   x = strlen(from) + 1;
-    ... when != \( x = E1 \| from = E1 \)
--   to = \(kmalloc\|kzalloc\)(x,flag);
-+   to = kstrdup(from, flag);
-    ... when != \(x = E2 \| from = E2 \| to = E2 \)
-    if (to==NULL || ...) S
-    ... when != \(x = E3 \| from = E3 \| to = E3 \)
--   memcpy(to, from, x);
-
-// ---------------------------------------------------------------------
-
- at r1 depends on !patch exists@
-expression from,to;
-expression flag,E1,E2;
-statement S;
-position p1,p2;
-@@
-
-*  to = kmalloc at p1(strlen(from) + 1,flag);
-   ... when != \(from = E1 \| to = E1 \)
-   if (to==NULL || ...) S
-   ... when != \(from = E2 \| to = E2 \)
-*  strcpy at p2(to, from);
-
- at r2 depends on !patch exists@
-expression x,from,to;
-expression flag,E1,E2,E3;
-statement S;
-position p1,p2;
-@@
-
-*   x = strlen(from) + 1;
-    ... when != \( x = E1 \| from = E1 \)
-*   to = \(kmalloc at p1\|kzalloc at p2\)(x,flag);
-    ... when != \(x = E2 \| from = E2 \| to = E2 \)
-    if (to==NULL || ...) S
-    ... when != \(x = E3 \| from = E3 \| to = E3 \)
-*   memcpy at p2(to, from, x);
-
- at script:python depends on org@
-p1 << r1.p1;
-p2 << r1.p2;
-@@
-
-cocci.print_main("WARNING opportunity for kstrdep",p1)
-cocci.print_secs("strcpy",p2)
-
- at script:python depends on org@
-p1 << r2.p1;
-p2 << r2.p2;
-@@
-
-cocci.print_main("WARNING opportunity for kstrdep",p1)
-cocci.print_secs("memcpy",p2)
-
- at script:python depends on report@
-p1 << r1.p1;
-p2 << r1.p2;
-@@
-
-msg = "WARNING opportunity for kstrdep (strcpy on line %s)" % (p2[0].line)
-coccilib.report.print_report(p1[0], msg)
-
- at script:python depends on report@
-p1 << r2.p1;
-p2 << r2.p2;
-@@
-
-msg = "WARNING opportunity for kstrdep (memcpy on line %s)" % (p2[0].line)
-coccilib.report.print_report(p1[0], msg)
diff --git a/helpers/coccinelle/api/memdup.cocci b/helpers/coccinelle/api/memdup.cocci
deleted file mode 100644
index 3d1aa71..0000000
--- a/helpers/coccinelle/api/memdup.cocci
+++ /dev/null
@@ -1,66 +0,0 @@
-/// Use kmemdup rather than duplicating its implementation
-///
-// Confidence: High
-// 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:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at r1@
-expression from,to;
-expression flag;
-position p;
-@@
-
-   to = \(kmalloc at p\|kzalloc at p\)(strlen(from) + 1,flag);
-
- at r2@
-expression x,from,to;
-expression flag,E1;
-position p;
-@@
-
-    x = strlen(from) + 1;
-    ... when != \( x = E1 \| from = E1 \)
-    to = \(kmalloc at p\|kzalloc at p\)(x,flag);
-
- at depends on patch@
-expression from,to,size,flag;
-position p != {r1.p,r2.p};
-statement S;
-@@
-
--  to = \(kmalloc at p\|kzalloc at p\)(size,flag);
-+  to = kmemdup(from,size,flag);
-   if (to==NULL || ...) S
--  memcpy(to, from, size);
-
- at r depends on !patch@
-expression from,to,size,flag;
-position p != {r1.p,r2.p};
-statement S;
-@@
-
-*  to = \(kmalloc at p\|kzalloc at p\)(size,flag);
-   to = kmemdup(from,size,flag);
-   if (to==NULL || ...) S
-*  memcpy(to, from, size);
-
- at script:python depends on org@
-p << r.p;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep")
-
- at script:python depends on report@
-p << r.p;
-@@
-
-coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep")
diff --git a/helpers/coccinelle/api/memdup_user.cocci b/helpers/coccinelle/api/memdup_user.cocci
deleted file mode 100644
index c606231..0000000
--- a/helpers/coccinelle/api/memdup_user.cocci
+++ /dev/null
@@ -1,60 +0,0 @@
-/// Use memdup_user rather than duplicating its implementation
-/// This is a little bit restricted to reduce false positives
-///
-// Confidence: High
-// 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:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at depends on patch@
-expression from,to,size,flag;
-identifier l1,l2;
-@@
-
--  to = \(kmalloc\|kzalloc\)(size,flag);
-+  to = memdup_user(from,size);
-   if (
--      to==NULL
-+      IS_ERR(to)
-                 || ...) {
-   <+... when != goto l1;
--  -ENOMEM
-+  PTR_ERR(to)
-   ...+>
-   }
--  if (copy_from_user(to, from, size) != 0) {
--    <+... when != goto l2;
--    -EFAULT
--    ...+>
--  }
-
- at r depends on !patch@
-expression from,to,size,flag;
-position p;
-statement S1,S2;
-@@
-
-*  to = \(kmalloc at p\|kzalloc at p\)(size,flag);
-   if (to==NULL || ...) S1
-   if (copy_from_user(to, from, size) != 0)
-   S2
-
- at script:python depends on org@
-p << r.p;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING opportunity for memdup_user")
-
- at script:python depends on report@
-p << r.p;
-@@
-
-coccilib.report.print_report(p[0], "WARNING opportunity for memdup_user")
diff --git a/helpers/coccinelle/api/ptr_ret.cocci b/helpers/coccinelle/api/ptr_ret.cocci
deleted file mode 100644
index e18f840..0000000
--- a/helpers/coccinelle/api/ptr_ret.cocci
+++ /dev/null
@@ -1,96 +0,0 @@
-///
-/// Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
-///
-// Confidence: High
-// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.  GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Options: --no-includes --include-headers
-//
-// Keywords: ERR_PTR, PTR_ERR, PTR_RET, PTR_ERR_OR_ZERO
-// Version min: 2.6.39
-//
-
-virtual context
-virtual patch
-virtual org
-virtual report
-
- at depends on patch@
-expression ptr;
-@@
-
-- if (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0;
-+ return PTR_ERR_OR_ZERO(ptr);
-
- at depends on patch@
-expression ptr;
-@@
-
-- if (IS_ERR(ptr)) return PTR_ERR(ptr); return 0;
-+ return PTR_ERR_OR_ZERO(ptr);
-
- at depends on patch@
-expression ptr;
-@@
-
-- (IS_ERR(ptr) ? PTR_ERR(ptr) : 0)
-+ PTR_ERR_OR_ZERO(ptr)
-
- at r1 depends on !patch@
-expression ptr;
-position p1;
-@@
-
-* if at p1 (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0;
-
- at r2 depends on !patch@
-expression ptr;
-position p2;
-@@
-
-* if at p2 (IS_ERR(ptr)) return PTR_ERR(ptr); return 0;
-
- at r3 depends on !patch@
-expression ptr;
-position p3;
-@@
-
-* IS_ERR at p3(ptr) ? PTR_ERR(ptr) : 0
-
- at script:python depends on org@
-p << r1.p1;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used")
-
-
- at script:python depends on org@
-p << r2.p2;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used")
-
- at script:python depends on org@
-p << r3.p3;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used")
-
- at script:python depends on report@
-p << r1.p1;
-@@
-
-coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used")
-
- at script:python depends on report@
-p << r2.p2;
-@@
-
-coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used")
-
- at script:python depends on report@
-p << r3.p3;
-@@
-
-coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used")
diff --git a/helpers/coccinelle/api/resource_size.cocci b/helpers/coccinelle/api/resource_size.cocci
deleted file mode 100644
index 1935a58..0000000
--- a/helpers/coccinelle/api/resource_size.cocci
+++ /dev/null
@@ -1,93 +0,0 @@
-///
-/// Use resource_size function on resource object
-/// instead of explicit computation.
-///
-//  Confidence: High
-//  Copyright: (C) 2009, 2010 Nicolas Palix, DIKU.  GPLv2.
-//  Copyright: (C) 2009, 2010 Julia Lawall, DIKU.  GPLv2.
-//  Copyright: (C) 2009, 2010 Gilles Muller, INRIA/LiP6.  GPLv2.
-//  URL: http://coccinelle.lip6.fr/
-//  Options:
-//
-//  Keywords: resource_size
-//  Version min: 2.6.27 resource_size
-//
-
-virtual context
-virtual patch
-virtual org
-virtual report
-
-//----------------------------------------------------------
-//  For context mode
-//----------------------------------------------------------
-
- at r_context depends on context && !patch && !org@
-struct resource *res;
-@@
-
-* (res->end - res->start) + 1
-
-//----------------------------------------------------------
-//  For patch mode
-//----------------------------------------------------------
-
- at r_patch depends on !context && patch && !org@
-struct resource *res;
-@@
-
-- (res->end - res->start) + 1
-+ resource_size(res)
-
-//----------------------------------------------------------
-//  For org mode
-//----------------------------------------------------------
-
-
- at r_org depends on !context && !patch && (org || report)@
-struct resource *res;
-position p;
-@@
-
- (res->end at p - res->start) + 1
-
- at rbad_org depends on !context && !patch && (org || report)@
-struct resource *res;
-position p != r_org.p;
-@@
-
- res->end at p - res->start
-
- at script:python depends on org@
-p << r_org.p;
-x << r_org.res;
-@@
-
-msg="ERROR with %s" % (x)
-msg_safe=msg.replace("[","@(").replace("]",")")
-coccilib.org.print_todo(p[0], msg_safe)
-
- at script:python depends on report@
-p << r_org.p;
-x << r_org.res;
-@@
-
-msg="ERROR: Missing resource_size with %s" % (x)
-coccilib.report.print_report(p[0], msg)
-
- at script:python depends on org@
-p << rbad_org.p;
-x << rbad_org.res;
-@@
-
-msg="WARNING with %s" % (x)
-msg_safe=msg.replace("[","@(").replace("]",")")
-coccilib.org.print_todo(p[0], msg_safe)
-
- at script:python depends on report@
-p << rbad_org.p;
-x << rbad_org.res;
-@@
-
-msg="WARNING: Suspicious code. resource_size is maybe missing with %s" % (x)
-coccilib.report.print_report(p[0], msg)
diff --git a/helpers/coccinelle/api/simple_open.cocci b/helpers/coccinelle/api/simple_open.cocci
deleted file mode 100644
index b67e174..0000000
--- a/helpers/coccinelle/api/simple_open.cocci
+++ /dev/null
@@ -1,70 +0,0 @@
-/// This removes an open coded simple_open() function
-/// and replaces file operations references to the function
-/// with simple_open() instead.
-///
-// Confidence: High
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual report
-
-@ open depends on patch @
-identifier open_f != simple_open;
-identifier i, f;
-@@
--int open_f(struct inode *i, struct file *f)
--{
-(
--if (i->i_private)
--f->private_data = i->i_private;
-|
--f->private_data = i->i_private;
-)
--return 0;
--}
-
-@ has_open depends on open @
-identifier fops;
-identifier open.open_f;
-@@
-struct file_operations fops = {
-...,
--.open = open_f,
-+.open = simple_open,
-...
-};
-
-@ openr depends on report @
-identifier open_f != simple_open;
-identifier i, f;
-position p;
-@@
-int open_f at p(struct inode *i, struct file *f)
-{
-(
-if (i->i_private)
-f->private_data = i->i_private;
-|
-f->private_data = i->i_private;
-)
-return 0;
-}
-
-@ has_openr depends on openr @
-identifier fops;
-identifier openr.open_f;
-position p;
-@@
-struct file_operations fops = {
-...,
-.open = open_f at p,
-...
-};
-
- at script:python@
-pf << openr.p;
-ps << has_openr.p;
-@@
-
-coccilib.report.print_report(pf[0],"WARNING opportunity for simple_open, see also structure on line %s"%(ps[0].line))
diff --git a/helpers/coccinelle/free/clk_put.cocci b/helpers/coccinelle/free/clk_put.cocci
deleted file mode 100644
index 46747ad..0000000
--- a/helpers/coccinelle/free/clk_put.cocci
+++ /dev/null
@@ -1,67 +0,0 @@
-/// Find missing clk_puts.
-///
-//# This only signals a missing clk_put when there is a clk_put later
-//# in the same function.
-//# False positives can be due to loops.
-//
-// Confidence: Moderate
-// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.  GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options:
-
-virtual context
-virtual org
-virtual report
-
- at clk@
-expression e;
-statement S,S1;
-int ret;
-position p1,p2,p3;
-@@
-
-e = clk_get at p1(...)
-... when != clk_put(e)
-if (<+...e...+>) S
-... when any
-    when != clk_put(e)
-    when != if (...) { ... clk_put(e); ... }
-(
- if (ret == 0) S1
-|
-if (...)
-   { ...
-     return 0; }
-|
-if (...)
-   { ...
-     return <+...e...+>; }
-|
-*if at p2 (...)
-   { ... when != clk_put(e)
-         when forall
-     return at p3 ...; }
-)
-... when any
-clk_put(e);
-
- at script:python depends on org@
-p1 << clk.p1;
-p2 << clk.p2;
-p3 << clk.p3;
-@@
-
-cocci.print_main("clk_get",p1)
-cocci.print_secs("if",p2)
-cocci.print_secs("needed clk_put",p3)
-
- at script:python depends on report@
-p1 << clk.p1;
-p2 << clk.p2;
-p3 << clk.p3;
-@@
-
-msg = "ERROR: missing clk_put; clk_get on line %s and execution via conditional on line %s" % (p1[0].line,p2[0].line)
-coccilib.report.print_report(p3[0],msg)
diff --git a/helpers/coccinelle/free/devm_free.cocci b/helpers/coccinelle/free/devm_free.cocci
deleted file mode 100644
index 3d93490..0000000
--- a/helpers/coccinelle/free/devm_free.cocci
+++ /dev/null
@@ -1,71 +0,0 @@
-/// Find uses of standard freeing functons on values allocated using devm_
-/// functions.  Values allocated using the devm_functions are freed when
-/// the device is detached, and thus the use of the standard freeing
-/// function would cause a double free.
-/// See Documentation/driver-model/devres.txt for more information.
-///
-/// A difficulty of detecting this problem is that the standard freeing
-/// function might be called from a different function than the one
-/// containing the allocation function.  It is thus necessary to make the
-/// connection between the allocation function and the freeing function.
-/// Here this is done using the specific argument text, which is prone to
-/// false positives.  There is no rule for the request_region and
-/// request_mem_region variants because this heuristic seems to be a bit
-/// less reliable in these cases.
-///
-// Confidence: Moderate
-// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6.  GPLv2.
-// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual org
-virtual report
-virtual context
-
- at r depends on context || org || report@
-expression x;
-@@
-
-(
- x = devm_kzalloc(...)
-|
- x = devm_request_irq(...)
-|
- x = devm_ioremap(...)
-|
- x = devm_ioremap_nocache(...)
-|
- x = devm_ioport_map(...)
-)
-
- at pb@
-expression r.x;
-position p;
-@@
-
-(
-* kfree at p(x)
-|
-* free_irq at p(x)
-|
-* iounmap at p(x)
-|
-* ioport_unmap at p(x)
-)
-
- at script:python depends on org@
-p << pb.p;
-@@
-
-msg="WARNING: invalid free of devm_ allocated data"
-coccilib.org.print_todo(p[0], msg)
-
- at script:python depends on report@
-p << pb.p;
-@@
-
-msg="WARNING: invalid free of devm_ allocated data"
-coccilib.report.print_report(p[0], msg)
-
diff --git a/helpers/coccinelle/free/iounmap.cocci b/helpers/coccinelle/free/iounmap.cocci
deleted file mode 100644
index 5384f4b..0000000
--- a/helpers/coccinelle/free/iounmap.cocci
+++ /dev/null
@@ -1,67 +0,0 @@
-/// Find missing iounmaps.
-///
-//# This only signals a missing iounmap when there is an iounmap later
-//# in the same function.
-//# False positives can be due to loops.
-//
-// Confidence: Moderate
-// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.  GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options:
-
-virtual context
-virtual org
-virtual report
-
- at iom@
-expression e;
-statement S,S1;
-int ret;
-position p1,p2,p3;
-@@
-
-e = \(ioremap at p1\|ioremap_nocache at p1\)(...)
-... when != iounmap(e)
-if (<+...e...+>) S
-... when any
-    when != iounmap(e)
-    when != if (...) { ... iounmap(e); ... }
-(
- if (ret == 0) S1
-|
-if (...)
-   { ...
-     return 0; }
-|
-if (...)
-   { ...
-     return <+...e...+>; }
-|
-*if at p2 (...)
-   { ... when != iounmap(e)
-         when forall
-     return at p3 ...; }
-)
-... when any
-iounmap(e);
-
- at script:python depends on org@
-p1 << iom.p1;
-p2 << iom.p2;
-p3 << iom.p3;
-@@
-
-cocci.print_main("ioremap",p1)
-cocci.print_secs("if",p2)
-cocci.print_secs("needed iounmap",p3)
-
- at script:python depends on report@
-p1 << iom.p1;
-p2 << iom.p2;
-p3 << iom.p3;
-@@
-
-msg = "ERROR: missing iounmap; ioremap on line %s and execution via conditional on line %s" % (p1[0].line,p2[0].line)
-coccilib.report.print_report(p3[0],msg)
diff --git a/helpers/coccinelle/free/kfree.cocci b/helpers/coccinelle/free/kfree.cocci
deleted file mode 100644
index 577b780..0000000
--- a/helpers/coccinelle/free/kfree.cocci
+++ /dev/null
@@ -1,121 +0,0 @@
-/// Find a use after free.
-//# Values of variables may imply that some
-//# execution paths are not possible, resulting in false positives.
-//# Another source of false positives are macros such as
-//# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument
-///
-// Confidence: Moderate
-// 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:
-// Options: --no-includes --include-headers
-
-virtual org
-virtual report
-
- at free@
-expression E;
-position p1;
-@@
-
-kfree at p1(E)
-
- at print expression@
-constant char [] c;
-expression free.E,E2;
-type T;
-position p;
-identifier f;
-@@
-
-(
- f(...,c,...,(T)E at p,...)
-|
- E at p == E2
-|
- E at p != E2
-|
- E2 == E at p
-|
- E2 != E at p
-|
- !E at p
-|
- E at p || ...
-)
-
- at sz@
-expression free.E;
-position p;
-@@
-
- sizeof(<+...E at p...+>)
-
- at loop exists@
-expression E;
-identifier l;
-position ok;
-@@
-
-while (1) { ...
-  kfree at ok(E)
-  ... when != break;
-      when != goto l;
-      when forall
-}
-
- at r exists@
-expression free.E, subE<=free.E, E2;
-expression E1;
-iterator iter;
-statement S;
-position free.p1!=loop.ok,p2!={print.p,sz.p};
-@@
-
-kfree at p1(E,...)
-...
-(
- iter(...,subE,...) S // no use
-|
- list_remove_head(E1,subE,...)
-|
- subE = E2
-|
- subE++
-|
- ++subE
-|
- --subE
-|
- subE--
-|
- &subE
-|
- BUG(...)
-|
- BUG_ON(...)
-|
- return_VALUE(...)
-|
- return_ACPI_STATUS(...)
-|
- E at p2 // bad use
-)
-
- at script:python depends on org@
-p1 << free.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("kfree",p1)
-cocci.print_secs("ref",p2)
-
- at script:python depends on report@
-p1 << free.p1;
-p2 << r.p2;
-@@
-
-msg = "ERROR: reference preceded by free on line %s" % (p1[0].line)
-coccilib.report.print_report(p2[0],msg)
diff --git a/helpers/coccinelle/free/kfreeaddr.cocci b/helpers/coccinelle/free/kfreeaddr.cocci
deleted file mode 100644
index ce8aacc..0000000
--- a/helpers/coccinelle/free/kfreeaddr.cocci
+++ /dev/null
@@ -1,32 +0,0 @@
-/// Free of a structure field
-///
-// Confidence: High
-// Copyright: (C) 2013 Julia Lawall, INRIA/LIP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual org
-virtual report
-virtual context
-
- at r depends on context || report || org @
-expression e;
-identifier f;
-position p;
-@@
-
-* kfree at p(&e->f)
-
- at script:python depends on org@
-p << r.p;
-@@
-
-cocci.print_main("kfree",p)
-
- at script:python depends on report@
-p << r.p;
-@@
-
-msg = "ERROR: kfree of structure field"
-coccilib.report.print_report(p[0],msg)
diff --git a/helpers/coccinelle/free/pci_free_consistent.cocci b/helpers/coccinelle/free/pci_free_consistent.cocci
deleted file mode 100644
index 43600cc..0000000
--- a/helpers/coccinelle/free/pci_free_consistent.cocci
+++ /dev/null
@@ -1,52 +0,0 @@
-/// Find missing pci_free_consistent for every pci_alloc_consistent.
-///
-// Confidence: Moderate
-// Copyright: (C) 2013 Petr Strnad.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Keywords: pci_free_consistent, pci_alloc_consistent
-// Options: --no-includes --include-headers
-
-virtual report
-virtual org
-
- at search@
-local idexpression id;
-expression x,y,z,e;
-position p1,p2;
-type T;
-@@
-
-id = pci_alloc_consistent at p1(x,y,&z)
-... when != e = id
-if (id == NULL || ...) { ... return ...; }
-... when != pci_free_consistent(x,y,id,z)
-    when != if (id) { ... pci_free_consistent(x,y,id,z) ... }
-    when != if (y) { ... pci_free_consistent(x,y,id,z) ... }
-    when != e = (T)id
-    when exists
-(
-return 0;
-|
-return 1;
-|
-return id;
-|
-return at p2 ...;
-)
-
- at script:python depends on report@
-p1 << search.p1;
-p2 << search.p2;
-@@
-
-msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
-coccilib.report.print_report(p2[0],msg)
-
- at script:python depends on org@
-p1 << search.p1;
-p2 << search.p2;
-@@
-
-msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
-cocci.print_main(msg,p1)
-cocci.print_secs("",p2)
diff --git a/helpers/coccinelle/iterators/fen.cocci b/helpers/coccinelle/iterators/fen.cocci
deleted file mode 100644
index 48c152f..0000000
--- a/helpers/coccinelle/iterators/fen.cocci
+++ /dev/null
@@ -1,123 +0,0 @@
-/// These iterators only exit normally when the loop cursor is NULL, so there
-/// is no point to call of_node_put on the final value.
-///
-// Confidence: High
-// 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:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at depends on patch@
-iterator name for_each_node_by_name;
-expression np,E;
-identifier l;
-@@
-
-for_each_node_by_name(np,...) {
-  ... when != break;
-      when != goto l;
-}
-... when != np = E
-- of_node_put(np);
-
- at depends on patch@
-iterator name for_each_node_by_type;
-expression np,E;
-identifier l;
-@@
-
-for_each_node_by_type(np,...) {
-  ... when != break;
-      when != goto l;
-}
-... when != np = E
-- of_node_put(np);
-
- at depends on patch@
-iterator name for_each_compatible_node;
-expression np,E;
-identifier l;
-@@
-
-for_each_compatible_node(np,...) {
-  ... when != break;
-      when != goto l;
-}
-... when != np = E
-- of_node_put(np);
-
- at depends on patch@
-iterator name for_each_matching_node;
-expression np,E;
-identifier l;
-@@
-
-for_each_matching_node(np,...) {
-  ... when != break;
-      when != goto l;
-}
-... when != np = E
-- of_node_put(np);
-
-// ----------------------------------------------------------------------
-
- at r depends on !patch forall@
-//iterator name for_each_node_by_name;
-//iterator name for_each_node_by_type;
-//iterator name for_each_compatible_node;
-//iterator name for_each_matching_node;
-expression np,E;
-identifier l;
-position p1,p2;
-@@
-
-(
-*for_each_node_by_name at p1(np,...)
-{
-  ... when != break;
-      when != goto l;
-}
-|
-*for_each_node_by_type at p1(np,...)
-{
-  ... when != break;
-      when != goto l;
-}
-|
-*for_each_compatible_node at p1(np,...)
-{
-  ... when != break;
-      when != goto l;
-}
-|
-*for_each_matching_node at p1(np,...)
-{
-  ... when != break;
-      when != goto l;
-}
-)
-... when != np = E
-* of_node_put at p2(np);
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("unneeded of_node_put",p2)
-cocci.print_secs("iterator",p1)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "ERROR: of_node_put not needed after iterator on line %s" % (p1[0].line)
-coccilib.report.print_report(p2[0], msg)
diff --git a/helpers/coccinelle/iterators/itnull.cocci b/helpers/coccinelle/iterators/itnull.cocci
deleted file mode 100644
index f58732b..0000000
--- a/helpers/coccinelle/iterators/itnull.cocci
+++ /dev/null
@@ -1,94 +0,0 @@
-/// Many iterators have the property that the first argument is always bound
-/// to a real list element, never NULL.
-//# False positives arise for some iterators that do not have this property,
-//# or in cases when the loop cursor is reassigned.  The latter should only
-//# happen when the matched code is on the way to a loop exit (break, goto,
-//# or return).
-///
-// Confidence: Moderate
-// 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:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at depends on patch@
-iterator I;
-expression x,E,E1,E2;
-statement S,S1,S2;
-@@
-
-I(x,...) { <...
-(
-- if (x == NULL && ...) S
-|
-- if (x != NULL || ...)
-  S
-|
-- (x == NULL) ||
-  E
-|
-- (x != NULL) &&
-  E
-|
-- (x == NULL && ...) ? E1 :
-  E2
-|
-- (x != NULL || ...) ?
-  E1
-- : E2
-|
-- if (x == NULL && ...) S1 else
-  S2
-|
-- if (x != NULL || ...)
-  S1
-- else S2
-|
-+ BAD(
-  x == NULL
-+ )
-|
-+ BAD(
-  x != NULL
-+ )
-)
-  ...> }
-
- at r depends on !patch exists@
-iterator I;
-expression x,E;
-position p1,p2;
-@@
-
-*I at p1(x,...)
-{ ... when != x = E
-(
-*  x at p2 == NULL
-|
-*  x at p2 != NULL
-)
-  ... when any
-}
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("iterator-bound variable",p1)
-cocci.print_secs("useless NULL test",p2)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "ERROR: iterator variable bound on line %s cannot be NULL" % (p1[0].line)
-coccilib.report.print_report(p2[0], msg)
diff --git a/helpers/coccinelle/iterators/list_entry_update.cocci b/helpers/coccinelle/iterators/list_entry_update.cocci
deleted file mode 100644
index 873f444..0000000
--- a/helpers/coccinelle/iterators/list_entry_update.cocci
+++ /dev/null
@@ -1,62 +0,0 @@
-/// list_for_each_entry uses its first argument to get from one element of
-/// the list to the next, so it is usually not a good idea to reassign it.
-/// The first rule finds such a reassignment and the second rule checks
-/// that there is a path from the reassignment back to the top of the loop.
-///
-// Confidence: High
-// 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 context
-virtual org
-virtual report
-
- at r@
-iterator name list_for_each_entry;
-expression x,E;
-position p1,p2;
-@@
-
-list_for_each_entry at p1(x,...) { <... x =@p2 E ...> }
-
- at depends on context && !org && !report@
-expression x,E;
-position r.p1,r.p2;
-statement S;
-@@
-
-*x =@p2 E
-...
-list_for_each_entry at p1(x,...) S
-
-// ------------------------------------------------------------------------
-
- at back depends on (org || report) && !context exists@
-expression x,E;
-position r.p1,r.p2;
-statement S;
-@@
-
-x =@p2 E
-...
-list_for_each_entry at p1(x,...) S
-
- at script:python depends on back && org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("iterator",p1)
-cocci.print_secs("update",p2)
-
- at script:python depends on back && report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "iterator with update on line %s" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
diff --git a/helpers/coccinelle/iterators/use_after_iter.cocci b/helpers/coccinelle/iterators/use_after_iter.cocci
deleted file mode 100644
index f085f59..0000000
--- a/helpers/coccinelle/iterators/use_after_iter.cocci
+++ /dev/null
@@ -1,147 +0,0 @@
-/// If list_for_each_entry, etc complete a traversal of the list, the iterator
-/// variable ends up pointing to an address at an offset from the list head,
-/// and not a meaningful structure.  Thus this value should not be used after
-/// the end of the iterator.
-//#False positives arise when there is a goto in the iterator and the
-//#reported reference is at the label of this goto.  Some flag tests
-//#may also cause a report to be a false positive.
-///
-// Confidence: Moderate
-// 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 context
-virtual org
-virtual report
-
- at r exists@
-identifier c,member;
-expression E,x;
-iterator name list_for_each_entry;
-iterator name list_for_each_entry_reverse;
-iterator name list_for_each_entry_continue;
-iterator name list_for_each_entry_continue_reverse;
-iterator name list_for_each_entry_from;
-iterator name list_for_each_entry_safe;
-iterator name list_for_each_entry_safe_continue;
-iterator name list_for_each_entry_safe_from;
-iterator name list_for_each_entry_safe_reverse;
-iterator name hlist_for_each_entry;
-iterator name hlist_for_each_entry_continue;
-iterator name hlist_for_each_entry_from;
-iterator name hlist_for_each_entry_safe;
-statement S;
-position p1,p2;
-@@
-
-(
-list_for_each_entry at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_reverse at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_continue at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_continue_reverse at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_from at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_safe at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_safe_continue at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_safe_from at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-|
-list_for_each_entry_safe_reverse at p1(c,...,member) { ... when != break;
-                                 when forall
-                                 when strict
-}
-)
-...
-(
-list_for_each_entry(c,...) S
-|
-list_for_each_entry_reverse(c,...) S
-|
-list_for_each_entry_continue(c,...) S
-|
-list_for_each_entry_continue_reverse(c,...) S
-|
-list_for_each_entry_from(c,...) S
-|
-list_for_each_entry_safe(c,...) S
-|
-list_for_each_entry_safe(x,c,...) S
-|
-list_for_each_entry_safe_continue(c,...) S
-|
-list_for_each_entry_safe_continue(x,c,...) S
-|
-list_for_each_entry_safe_from(c,...) S
-|
-list_for_each_entry_safe_from(x,c,...) S
-|
-list_for_each_entry_safe_reverse(c,...) S
-|
-list_for_each_entry_safe_reverse(x,c,...) S
-|
-hlist_for_each_entry(c,...) S
-|
-hlist_for_each_entry_continue(c,...) S
-|
-hlist_for_each_entry_from(c,...) S
-|
-hlist_for_each_entry_safe(c,...) S
-|
-list_remove_head(x,c,...)
-|
-sizeof(<+...c...+>)
-|
-&c->member
-|
-c = E
-|
-*c at p2
-)
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("invalid iterator index reference",p2)
-cocci.print_secs("iterator",p1)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "ERROR: invalid reference to the index variable of the iterator on line %s" % (p1[0].line)
-coccilib.report.print_report(p2[0], msg)
diff --git a/helpers/coccinelle/locks/call_kern.cocci b/helpers/coccinelle/locks/call_kern.cocci
deleted file mode 100644
index 669b244..0000000
--- a/helpers/coccinelle/locks/call_kern.cocci
+++ /dev/null
@@ -1,105 +0,0 @@
-/// Find functions that refer to GFP_KERNEL but are called with locks held.
-//# The proposed change of converting the GFP_KERNEL is not necessarily the
-//# correct one.  It may be desired to unlock the lock, or to not call the
-//# function under the lock in the first place.
-///
-// Confidence: Moderate
-// Copyright: (C) 2012 Nicolas Palix.  GPLv2.
-// 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 patch
-virtual context
-virtual org
-virtual report
-
- at gfp exists@
-identifier fn;
-position p;
-@@
-
-fn(...) {
- ... when != read_unlock_irq(...)
-     when != write_unlock_irq(...)
-     when != read_unlock_irqrestore(...)
-     when != write_unlock_irqrestore(...)
-     when != spin_unlock(...)
-     when != spin_unlock_irq(...)
-     when != spin_unlock_irqrestore(...)
-     when != local_irq_enable(...)
-     when any
- GFP_KERNEL at p
- ... when any
-}
-
- at locked exists@
-identifier gfp.fn;
-position p1,p2;
-@@
-
-(
-read_lock_irq at p1
-|
-write_lock_irq at p1
-|
-read_lock_irqsave at p1
-|
-write_lock_irqsave at p1
-|
-spin_lock at p1
-|
-spin_trylock at p1
-|
-spin_lock_irq at p1
-|
-spin_lock_irqsave at p1
-|
-local_irq_disable at p1
-)
- (...)
-...  when != read_unlock_irq(...)
-     when != write_unlock_irq(...)
-     when != read_unlock_irqrestore(...)
-     when != write_unlock_irqrestore(...)
-     when != spin_unlock(...)
-     when != spin_unlock_irq(...)
-     when != spin_unlock_irqrestore(...)
-     when != local_irq_enable(...)
-fn at p2(...)
-
- at depends on locked && patch@
-position gfp.p;
-@@
-
-- GFP_KERNEL at p
-+ GFP_ATOMIC
-
- at depends on locked && !patch@
-position gfp.p;
-@@
-
-* GFP_KERNEL at p
-
- at script:python depends on !patch && org@
-p << gfp.p;
-fn << gfp.fn;
-p1 << locked.p1;
-p2 << locked.p2;
-@@
-
-cocci.print_main("lock",p1)
-cocci.print_secs("call",p2)
-cocci.print_secs("GFP_KERNEL",p)
-
- at script:python depends on !patch && report@
-p << gfp.p;
-fn << gfp.fn;
-p1 << locked.p1;
-p2 << locked.p2;
-@@
-
-msg = "ERROR: function %s called on line %s inside lock on line %s but uses GFP_KERNEL" % (fn,p2[0].line,p1[0].line)
-coccilib.report.print_report(p[0], msg)
diff --git a/helpers/coccinelle/locks/double_lock.cocci b/helpers/coccinelle/locks/double_lock.cocci
deleted file mode 100644
index 002752f..0000000
--- a/helpers/coccinelle/locks/double_lock.cocci
+++ /dev/null
@@ -1,92 +0,0 @@
-/// Find double locks.  False positives may occur when some paths cannot
-/// occur at execution, due to the values of variables, and when there is
-/// an intervening function call that releases the lock.
-///
-// Confidence: Moderate
-// 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
-
- at locked@
-position p1;
-expression E1;
-position p;
-@@
-
-(
-mutex_lock at p1
-|
-mutex_trylock at p1
-|
-spin_lock at p1
-|
-spin_trylock at p1
-|
-read_lock at p1
-|
-read_trylock at p1
-|
-write_lock at p1
-|
-write_trylock at p1
-) (E1 at p,...);
-
- at balanced@
-position p1 != locked.p1;
-position locked.p;
-identifier lock,unlock;
-expression x <= locked.E1;
-expression E,locked.E1;
-expression E2;
-@@
-
-if (E) {
- <+... when != E1
- lock(E1 at p,...)
- ...+>
-}
-... when != E1
-    when != \(x = E2\|&x\)
-    when forall
-if (E) {
- <+... when != E1
- unlock at p1(E1,...)
- ...+>
-}
-
- at r depends on !balanced exists@
-expression x <= locked.E1;
-expression locked.E1;
-expression E2;
-identifier lock;
-position locked.p,p1,p2;
-@@
-
-lock at p1 (E1 at p,...);
-... when != E1
-    when != \(x = E2\|&x\)
-lock at p2 (E1,...);
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-lock << r.lock;
-@@
-
-cocci.print_main(lock,p1)
-cocci.print_secs("second lock",p2)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-lock << r.lock;
-@@
-
-msg = "second lock on line %s" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
diff --git a/helpers/coccinelle/locks/flags.cocci b/helpers/coccinelle/locks/flags.cocci
deleted file mode 100644
index debd70e..0000000
--- a/helpers/coccinelle/locks/flags.cocci
+++ /dev/null
@@ -1,80 +0,0 @@
-/// Find nested lock+irqsave functions that use the same flags variables
-///
-// Confidence: High
-// 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:
-// Options: --no-includes --include-headers
-
-virtual context
-virtual org
-virtual report
-
- at r exists@
-expression lock1,lock2,flags;
-position p1,p2;
-@@
-
-(
-spin_lock_irqsave at p1(lock1,flags)
-|
-read_lock_irqsave at p1(lock1,flags)
-|
-write_lock_irqsave at p1(lock1,flags)
-)
-... when != flags
-(
-spin_lock_irqsave(lock1,flags)
-|
-read_lock_irqsave(lock1,flags)
-|
-write_lock_irqsave(lock1,flags)
-|
-spin_lock_irqsave at p2(lock2,flags)
-|
-read_lock_irqsave at p2(lock2,flags)
-|
-write_lock_irqsave at p2(lock2,flags)
-)
-
- at d exists@
-expression f <= r.flags;
-expression lock1,lock2,flags;
-position r.p1, r.p2;
-@@
-
-(
-*spin_lock_irqsave at p1(lock1,flags)
-|
-*read_lock_irqsave at p1(lock1,flags)
-|
-*write_lock_irqsave at p1(lock1,flags)
-)
-... when != f
-(
-*spin_lock_irqsave at p2(lock2,flags)
-|
-*read_lock_irqsave at p2(lock2,flags)
-|
-*write_lock_irqsave at p2(lock2,flags)
-)
-
-// ----------------------------------------------------------------------
-
- at script:python depends on d && org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("original lock",p1)
-cocci.print_secs("nested lock+irqsave that reuses flags",p2)
-
- at script:python depends on d && report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg="ERROR: nested lock+irqsave that reuses flags from line %s." % (p1[0].line)
-coccilib.report.print_report(p2[0], msg)
diff --git a/helpers/coccinelle/locks/mini_lock.cocci b/helpers/coccinelle/locks/mini_lock.cocci
deleted file mode 100644
index 47f649b..0000000
--- a/helpers/coccinelle/locks/mini_lock.cocci
+++ /dev/null
@@ -1,96 +0,0 @@
-/// Find missing unlocks.  This semantic match considers the specific case
-/// where the unlock is missing from an if branch, and there is a lock
-/// before the if and an unlock after the if.  False positives are due to
-/// cases where the if branch represents a case where the function is
-/// supposed to exit with the lock held, or where there is some preceding
-/// function call that releases the lock.
-///
-// Confidence: Moderate
-// 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:
-// Options: --no-includes --include-headers
-
-virtual context
-virtual org
-virtual report
-
- at prelocked@
-position p1,p;
-expression E1;
-@@
-
-(
-mutex_lock at p1
-|
-mutex_trylock at p1
-|
-spin_lock at p1
-|
-spin_trylock at p1
-|
-read_lock at p1
-|
-read_trylock at p1
-|
-write_lock at p1
-|
-write_trylock at p1
-|
-read_lock_irq at p1
-|
-write_lock_irq at p1
-|
-read_lock_irqsave at p1
-|
-write_lock_irqsave at p1
-|
-spin_lock_irq at p1
-|
-spin_lock_irqsave at p1
-) (E1 at p,...);
-
- at looped@
-position r;
-@@
-
-for(...;...;...) { <+... return at r ...; ...+> }
-
- at err exists@
-expression E1;
-position prelocked.p;
-position up != prelocked.p1;
-position r!=looped.r;
-identifier lock,unlock;
-@@
-
-*lock(E1 at p,...);
-<+... when != E1
-if (...) {
-  ... when != E1
-*  return at r ...;
-}
-...+>
-*unlock at up(E1,...);
-
- at script:python depends on org@
-p << prelocked.p1;
-lock << err.lock;
-unlock << err.unlock;
-p2 << err.r;
-@@
-
-cocci.print_main(lock,p)
-cocci.print_secs(unlock,p2)
-
- at script:python depends on report@
-p << prelocked.p1;
-lock << err.lock;
-unlock << err.unlock;
-p2 << err.r;
-@@
-
-msg = "preceding lock on line %s" % (p[0].line)
-coccilib.report.print_report(p2[0],msg)
diff --git a/helpers/coccinelle/misc/boolinit.cocci b/helpers/coccinelle/misc/boolinit.cocci
deleted file mode 100644
index b9abed4..0000000
--- a/helpers/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
-
- at 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
-)
-
- at depends on patch disable is_zero, isnt_zero@
-bool t;
-@@
-
-(
-- t == 1
-+ t
-|
-- t != 1
-+ !t
-|
-- t == 0
-+ !t
-|
-- t != 0
-+ t
-)
-
- at depends on patch@
-bool b;
-@@
-(
- b =
-- 0
-+ false
-|
- b =
-- 1
-+ true
-)
-
-// ---------------------------------------------------------------------
-
- at r1 depends on !patch@
-bool t;
-position p;
-@@
-
-(
-* t at p == true
-|
-* true == t at p
-|
-* t at p != true
-|
-* true != t at p
-|
-* t at p == false
-|
-* false == t at p
-|
-* t at p != false
-|
-* false != t at p
-)
-
- at r2 depends on !patch disable is_zero, isnt_zero@
-bool t;
-position p;
-@@
-
-(
-* t at p == 1
-|
-* t at p != 1
-|
-* t at p == 0
-|
-* t at p != 0
-)
-
- at r3 depends on !patch@
-bool b;
-position p1,p2;
-constant c;
-@@
-(
-*b at p1 = 0
-|
-*b at p1 = 1
-|
-*b at p2 = c
-)
-
- at script:python depends on org@
-p << r1.p;
-@@
-
-cocci.print_main("WARNING: Comparison to bool",p)
-
- at script:python depends on org@
-p << r2.p;
-@@
-
-cocci.print_main("WARNING: Comparison of bool to 0/1",p)
-
- at script:python depends on org@
-p1 << r3.p1;
-@@
-
-cocci.print_main("WARNING: Assignment of bool to 0/1",p1)
-
- at script:python depends on org@
-p2 << r3.p2;
-@@
-
-cocci.print_main("ERROR: Assignment of bool to non-0/1 constant",p2)
-
- at script:python depends on report@
-p << r1.p;
-@@
-
-coccilib.report.print_report(p[0],"WARNING: Comparison to bool")
-
- at script:python depends on report@
-p << r2.p;
-@@
-
-coccilib.report.print_report(p[0],"WARNING: Comparison of bool to 0/1")
-
- at script:python depends on report@
-p1 << r3.p1;
-@@
-
-coccilib.report.print_report(p1[0],"WARNING: Assignment of bool to 0/1")
-
- at 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/helpers/coccinelle/misc/boolreturn.cocci b/helpers/coccinelle/misc/boolreturn.cocci
deleted file mode 100644
index a43c7b0..0000000
--- a/helpers/coccinelle/misc/boolreturn.cocci
+++ /dev/null
@@ -1,58 +0,0 @@
-/// Return statements in functions returning bool should use
-/// true/false instead of 1/0.
-//
-// Confidence: High
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual report
-virtual context
-
- at r1 depends on patch@
-identifier fn;
-typedef bool;
-symbol false;
-symbol true;
-@@
-
-bool fn ( ... )
-{
-<...
-return
-(
-- 0
-+ false
-|
-- 1
-+ true
-)
-  ;
-...>
-}
-
- at r2 depends on report || context@
-identifier fn;
-position p;
-@@
-
-bool fn ( ... )
-{
-<...
-return
-(
-* 0 at p
-|
-* 1 at p
-)
-  ;
-...>
-}
-
-
- at script:python depends on report@
-p << r2.p;
-fn << r2.fn;
-@@
-
-msg = "WARNING: return of 0/1 in function '%s' with return type bool" % fn
-coccilib.report.print_report(p[0], msg)
diff --git a/helpers/coccinelle/misc/cstptr.cocci b/helpers/coccinelle/misc/cstptr.cocci
deleted file mode 100644
index f0368b3..0000000
--- a/helpers/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
-
- at r exists@
-expression e,e1;
-constant c;
-position p1,p2;
-@@
-
-*e at p1 = c
-... when != e = e1
-    when != &e
-    when != true IS_ERR(e)
-*PTR_ERR at p2(e)
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("PTR_ERR",p2)
-cocci.print_secs("assignment",p1)
-
- at 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/helpers/coccinelle/misc/doubleinit.cocci b/helpers/coccinelle/misc/doubleinit.cocci
deleted file mode 100644
index c0c3371..0000000
--- a/helpers/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
-
- at r@
-identifier I, s, fld;
-position p0,p;
-expression E;
-@@
-
-struct I s =@p0 { ..., .fld at p = E, ...};
-
- at s@
-identifier I, s, r.fld;
-position r.p0,p;
-expression E;
-@@
-
-struct I s =@p0 { ..., .fld at p = E, ...};
-
- at 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)
-
- at 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/helpers/coccinelle/misc/ifaddr.cocci b/helpers/coccinelle/misc/ifaddr.cocci
deleted file mode 100644
index 8aebd18..0000000
--- a/helpers/coccinelle/misc/ifaddr.cocci
+++ /dev/null
@@ -1,35 +0,0 @@
-/// the address of a variable or field is non-zero is likely always to bo
-/// non-zero
-///
-// 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
-
- at r@
-expression x;
-statement S1,S2;
-position p;
-@@
-
-*if at p (&x)
- S1 else S2
-
- at script:python depends on org@
-p << r.p;
-@@
-
-cocci.print_main("test of a variable/field address",p)
-
- at script:python depends on report@
-p << r.p;
-@@
-
-msg = "ERROR: test of a variable/field address"
-coccilib.report.print_report(p[0],msg)
diff --git a/helpers/coccinelle/misc/ifcol.cocci b/helpers/coccinelle/misc/ifcol.cocci
deleted file mode 100644
index d0d00ef..0000000
--- a/helpers/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
-
- at r disable braces4@
-position p1,p2;
-statement S1,S2;
-@@
-
-(
-if (...) { ... }
-|
-if (...) S1 at p1 S2 at p2
-)
-
- at 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)
-
- at 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)
diff --git a/helpers/coccinelle/misc/irqf_oneshot.cocci b/helpers/coccinelle/misc/irqf_oneshot.cocci
deleted file mode 100644
index 6cfde94..0000000
--- a/helpers/coccinelle/misc/irqf_oneshot.cocci
+++ /dev/null
@@ -1,65 +0,0 @@
-/// Make sure threaded IRQs without a primary handler are always request with
-/// IRQF_ONESHOT
-///
-//
-// Confidence: Good
-// Comments:
-// Options: --no-includes
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at r1@
-expression irq;
-expression thread_fn;
-expression flags;
-position p;
-@@
-request_threaded_irq at p(irq, NULL, thread_fn,
-(
-flags | IRQF_ONESHOT
-|
-IRQF_ONESHOT
-)
-, ...)
-
- at depends on patch@
-expression irq;
-expression thread_fn;
-expression flags;
-position p != r1.p;
-@@
-request_threaded_irq at p(irq, NULL, thread_fn,
-(
--0
-+IRQF_ONESHOT
-|
--flags
-+flags | IRQF_ONESHOT
-)
-, ...)
-
- at depends on context@
-position p != r1.p;
-@@
-*request_threaded_irq at p(...)
-
- at match depends on report || org@
-expression irq;
-position p != r1.p;
-@@
-request_threaded_irq at p(irq, NULL, ...)
-
- at script:python depends on org@
-p << match.p;
-@@
-msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
-coccilib.org.print_todo(p[0],msg)
-
- at script:python depends on report@
-p << match.p;
-@@
-msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
-coccilib.report.print_report(p[0],msg)
diff --git a/helpers/coccinelle/misc/memcpy-assign.cocci b/helpers/coccinelle/misc/memcpy-assign.cocci
deleted file mode 100644
index afd058b..0000000
--- a/helpers/coccinelle/misc/memcpy-assign.cocci
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Replace memcpy with struct assignment.
-//
-// Confidence: High
-// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual report
-virtual context
-virtual org
-
- at r1 depends on !patch@
-identifier struct_name;
-struct struct_name to;
-struct struct_name from;
-struct struct_name *top;
-struct struct_name *fromp;
-position p;
-@@
-memcpy at p(\(&(to)\|top\), \(&(from)\|fromp\), \(sizeof(to)\|sizeof(from)\|sizeof(struct struct_name)\|sizeof(*top)\|sizeof(*fromp)\))
-
- at script:python depends on report@
-p << r1.p;
-@@
-coccilib.report.print_report(p[0],"Replace memcpy with struct assignment")
-
- at depends on context@
-position r1.p;
-@@
-*memcpy at p(...);
-
- at script:python depends on org@
-p << r1.p;
-@@
-cocci.print_main("Replace memcpy with struct assignment",p)
-
- at depends on patch@
-identifier struct_name;
-struct struct_name to;
-struct struct_name from;
-@@
-(
--memcpy(&(to), &(from), sizeof(to));
-+to = from;
-|
--memcpy(&(to), &(from), sizeof(from));
-+to = from;
-|
--memcpy(&(to), &(from), sizeof(struct struct_name));
-+to = from;
-)
-
- at depends on patch@
-identifier struct_name;
-struct struct_name to;
-struct struct_name *from;
-@@
-(
--memcpy(&(to), from, sizeof(to));
-+to = *from;
-|
--memcpy(&(to), from, sizeof(*from));
-+to = *from;
-|
--memcpy(&(to), from, sizeof(struct struct_name));
-+to = *from;
-)
-
- at depends on patch@
-identifier struct_name;
-struct struct_name *to;
-struct struct_name from;
-@@
-(
--memcpy(to, &(from), sizeof(*to));
-+ *to = from;
-|
--memcpy(to, &(from), sizeof(from));
-+ *to = from;
-|
--memcpy(to, &(from), sizeof(struct struct_name));
-+ *to = from;
-)
-
- at depends on patch@
-identifier struct_name;
-struct struct_name *to;
-struct struct_name *from;
-@@
-(
--memcpy(to, from, sizeof(*to));
-+ *to = *from;
-|
--memcpy(to, from, sizeof(*from));
-+ *to = *from;
-|
--memcpy(to, from, sizeof(struct struct_name));
-+ *to = *from;
-)
-
diff --git a/helpers/coccinelle/misc/noderef.cocci b/helpers/coccinelle/misc/noderef.cocci
deleted file mode 100644
index 80a831c..0000000
--- a/helpers/coccinelle/misc/noderef.cocci
+++ /dev/null
@@ -1,65 +0,0 @@
-/// sizeof when applied to a pointer typed expression gives the size of
-/// the pointer
-///
-// 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
-virtual patch
-
- at depends on patch@
-expression *x;
-expression f;
-type T;
-@@
-
-(
-x = <+... sizeof(
-- x
-+ *x
-   ) ...+>
-|
-f(...,(T)(x),...,sizeof(
-- x
-+ *x
-   ),...)
-|
-f(...,sizeof(x),...,(T)(
-- x
-+ *x
-   ),...)
-)
-
- at r depends on !patch@
-expression *x;
-expression f;
-position p;
-type T;
-@@
-
-(
-*x = <+... sizeof at p(x) ...+>
-|
-*f(...,(T)(x),...,sizeof at p(x),...)
-|
-*f(...,sizeof at p(x),...,(T)(x),...)
-)
-
- at script:python depends on org@
-p << r.p;
-@@
-
-cocci.print_main("application of sizeof to pointer",p)
-
- at script:python depends on report@
-p << r.p;
-@@
-
-msg = "ERROR: application of sizeof to pointer"
-coccilib.report.print_report(p[0],msg)
diff --git a/helpers/coccinelle/misc/orplus.cocci b/helpers/coccinelle/misc/orplus.cocci
deleted file mode 100644
index 81fabf3..0000000
--- a/helpers/coccinelle/misc/orplus.cocci
+++ /dev/null
@@ -1,55 +0,0 @@
-/// 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
-
- at r@
-constant c;
-identifier i;
-expression e;
-@@
-
-(
-e | c at i
-|
-e & c at i
-|
-e |= c at i
-|
-e &= c at i
-)
-
- at s@
-constant r.c,c1;
-identifier i1;
-position p;
-@@
-
-(
- c1 + c - 1
-|
-*c1 at i1 + at p c
-)
-
- at script:python depends on org@
-p << s.p;
-@@
-
-cocci.print_main("sum of probable bitmasks, consider |",p)
-
- at script:python depends on report@
-p << s.p;
-@@
-
-msg = "WARNING: sum of probable bitmasks, consider |"
-coccilib.report.print_report(p[0],msg)
diff --git a/helpers/coccinelle/misc/semicolon.cocci b/helpers/coccinelle/misc/semicolon.cocci
deleted file mode 100644
index a47eba2..0000000
--- a/helpers/coccinelle/misc/semicolon.cocci
+++ /dev/null
@@ -1,83 +0,0 @@
-///
-/// Removes unneeded semicolon.
-///
-// Confidence: Moderate
-// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments: Some false positives on empty default cases in switch statements.
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual report
-virtual context
-virtual org
-
- at r_default@
-position p;
-@@
-switch (...)
-{
-default: ...;@p
-}
-
- at r_case@
-position p;
-@@
-(
-switch (...)
-{
-case ...:;@p
-}
-|
-switch (...)
-{
-case ...:...
-case ...:;@p
-}
-|
-switch (...)
-{
-case ...:...
-case ...:
-case ...:;@p
-}
-)
-
- at r1@
-statement S;
-position p1;
-position p != {r_default.p, r_case.p};
-identifier label;
-@@
-(
-label:;
-|
-S at p1;@p
-)
-
- at script:python@
-p << r1.p;
-p1 << r1.p1;
-@@
-if p[0].line != p1[0].line_end:
-	cocci.include_match(False)
-
- at depends on patch@
-position r1.p;
-@@
--;@p
-
- at script:python depends on report@
-p << r1.p;
-@@
-coccilib.report.print_report(p[0],"Unneeded semicolon")
-
- at depends on context@
-position r1.p;
-@@
-*;@p
-
- at script:python depends on org@
-p << r1.p;
-@@
-cocci.print_main("Unneeded semicolon",p)
diff --git a/helpers/coccinelle/misc/warn.cocci b/helpers/coccinelle/misc/warn.cocci
deleted file mode 100644
index d2e5b6c..0000000
--- a/helpers/coccinelle/misc/warn.cocci
+++ /dev/null
@@ -1,109 +0,0 @@
-/// Use WARN(1,...) rather than printk followed by WARN_ON(1)
-///
-// 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 patch
-virtual context
-virtual org
-virtual report
-
- at bad1@
-position p;
-@@
-
-printk(...);
-printk at p(...);
-WARN_ON(1);
-
- at r1 depends on context || report || org@
-position p != bad1.p;
-@@
-
- printk at p(...);
-*WARN_ON(1);
-
- at script:python depends on org@
-p << r1.p;
-@@
-
-cocci.print_main("printk + WARN_ON can be just WARN",p)
-
- at script:python depends on report@
-p << r1.p;
-@@
-
-msg = "SUGGESTION: printk + WARN_ON can be just WARN"
-coccilib.report.print_report(p[0],msg)
-
- at ok1 depends on patch@
-expression list es;
-position p != bad1.p;
-@@
-
--printk at p(
-+WARN(1,
-  es);
--WARN_ON(1);
-
- at depends on patch@
-expression list ok1.es;
-@@
-
-if (...)
-- {
-  WARN(1,es);
-- }
-
-// --------------------------------------------------------------------
-
- at bad2@
-position p;
-@@
-
-printk(...);
-printk at p(...);
-WARN_ON_ONCE(1);
-
- at r2 depends on context || report || org@
-position p != bad1.p;
-@@
-
- printk at p(...);
-*WARN_ON_ONCE(1);
-
- at script:python depends on org@
-p << r2.p;
-@@
-
-cocci.print_main("printk + WARN_ON_ONCE can be just WARN_ONCE",p)
-
- at script:python depends on report@
-p << r2.p;
-@@
-
-msg = "SUGGESTION: printk + WARN_ON_ONCE can be just WARN_ONCE"
-coccilib.report.print_report(p[0],msg)
-
- at ok2 depends on patch@
-expression list es;
-position p != bad2.p;
-@@
-
--printk at p(
-+WARN_ONCE(1,
-  es);
--WARN_ON_ONCE(1);
-
- at depends on patch@
-expression list ok2.es;
-@@
-
-if (...)
-- {
-  WARN_ONCE(1,es);
-- }
diff --git a/helpers/coccinelle/null/badzero.cocci b/helpers/coccinelle/null/badzero.cocci
deleted file mode 100644
index d79baf7..0000000
--- a/helpers/coccinelle/null/badzero.cocci
+++ /dev/null
@@ -1,237 +0,0 @@
-/// Compare pointer-typed values to NULL rather than 0
-///
-//# This makes an effort to choose between !x and x == NULL.  !x is used
-//# if it has previously been used with the function used to initialize x.
-//# This relies on type information.  More type information can be obtained
-//# using the option -all_includes and the option -I to specify an
-//# include path.
-//
-// 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:
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at initialize:ocaml@
-let negtable = Hashtbl.create 101
-
- at depends on patch@
-expression *E;
-identifier f;
-@@
-
-(
-  (E = f(...)) ==
-- 0
-+ NULL
-|
-  (E = f(...)) !=
-- 0
-+ NULL
-|
-- 0
-+ NULL
-  == (E = f(...))
-|
-- 0
-+ NULL
-  != (E = f(...))
-)
-
-
- at t1 depends on !patch@
-expression *E;
-identifier f;
-position p;
-@@
-
-(
-  (E = f(...)) ==
-* 0 at p
-|
-  (E = f(...)) !=
-* 0 at p
-|
-* 0 at p
-  == (E = f(...))
-|
-* 0 at p
-  != (E = f(...))
-)
-
- at script:python depends on org@
-p << t1.p;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0")
-
- at script:python depends on report@
-p << t1.p;
-@@
-
-coccilib.report.print_report(p[0], "WARNING comparing pointer to 0")
-
-// Tests of returned values
-
- at s@
-identifier f;
-expression E,E1;
-@@
-
- E = f(...)
- ... when != E = E1
- !E
-
- at script:ocaml depends on s@
-f << s.f;
-@@
-
-try let _ = Hashtbl.find negtable f in ()
-with Not_found -> Hashtbl.add negtable f ()
-
-@ r disable is_zero,isnt_zero exists @
-expression *E;
-identifier f;
-@@
-
-E = f(...)
-...
-(E == 0
-|E != 0
-|0 == E
-|0 != E
-)
-
- at script:ocaml@
-f << r.f;
-@@
-
-try let _ = Hashtbl.find negtable f in ()
-with Not_found -> include_match false
-
-// This rule may lead to inconsistent path problems, if E is defined in two
-// places
-@ depends on patch disable is_zero,isnt_zero @
-expression *E;
-expression E1;
-identifier r.f;
-@@
-
-E = f(...)
-<...
-(
-- E == 0
-+ !E
-|
-- E != 0
-+ E
-|
-- 0 == E
-+ !E
-|
-- 0 != E
-+ E
-)
-...>
-?E = E1
-
- at t2 depends on !patch disable is_zero,isnt_zero @
-expression *E;
-expression E1;
-identifier r.f;
-position p1;
-position p2;
-@@
-
-E = f(...)
-<...
-(
-* E == 0 at p1
-|
-* E != 0 at p2
-|
-* 0 at p1 == E
-|
-* 0 at p1 != E
-)
-...>
-?E = E1
-
- at script:python depends on org@
-p << t2.p1;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0, suggest !E")
-
- at script:python depends on org@
-p << t2.p2;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0")
-
- at script:python depends on report@
-p << t2.p1;
-@@
-
-coccilib.report.print_report(p[0], "WARNING comparing pointer to 0, suggest !E")
-
- at script:python depends on report@
-p << t2.p2;
-@@
-
-coccilib.report.print_report(p[0], "WARNING comparing pointer to 0")
-
-@ depends on patch disable is_zero,isnt_zero @
-expression *E;
-@@
-
-(
-  E ==
-- 0
-+ NULL
-|
-  E !=
-- 0
-+ NULL
-|
-- 0
-+ NULL
-  == E
-|
-- 0
-+ NULL
-  != E
-)
-
-@ t3 depends on !patch disable is_zero,isnt_zero @
-expression *E;
-position p;
-@@
-
-(
-* E == 0 at p
-|
-* E != 0 at p
-|
-* 0 at p == E
-|
-* 0 at p != E
-)
-
- at script:python depends on org@
-p << t3.p;
-@@
-
-coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0")
-
- at script:python depends on report@
-p << t3.p;
-@@
-
-coccilib.report.print_report(p[0], "WARNING comparing pointer to 0")
diff --git a/helpers/coccinelle/null/deref_null.cocci b/helpers/coccinelle/null/deref_null.cocci
deleted file mode 100644
index cdac6cf..0000000
--- a/helpers/coccinelle/null/deref_null.cocci
+++ /dev/null
@@ -1,282 +0,0 @@
-///
-/// A variable is dereference under a NULL test.
-/// Even though it is know to be NULL.
-///
-// Confidence: Moderate
-// 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: -I ... -all_includes can give more complete results
-// Options:
-
-virtual context
-virtual org
-virtual report
-
- at ifm@
-expression *E;
-statement S1,S2;
-position p1;
-@@
-
-if at p1 ((E == NULL && ...) || ...) S1 else S2
-
-// The following two rules are separate, because both can match a single
-// expression in different ways
- at pr1 expression@
-expression *ifm.E;
-identifier f;
-position p1;
-@@
-
- (E != NULL && ...) ? <+...E->f at p1...+> : ...
-
- at pr2 expression@
-expression *ifm.E;
-identifier f;
-position p2;
-@@
-
-(
-  (E != NULL) && ... && <+...E->f at p2...+>
-|
-  (E == NULL) || ... || <+...E->f at p2...+>
-|
- sizeof(<+...E->f at p2...+>)
-)
-
-// For org and report modes
-
- at r depends on !context && (org || report) exists@
-expression subE <= ifm.E;
-expression *ifm.E;
-expression E1,E2;
-identifier f;
-statement S1,S2,S3,S4;
-iterator iter;
-position p!={pr1.p1,pr2.p2};
-position ifm.p1;
-@@
-
-if at p1 ((E == NULL && ...) || ...)
-{
-  ... when != if (...) S1 else S2
-(
- iter(subE,...) S4 // no use
-|
- list_remove_head(E2,subE,...)
-|
- subE = E1
-|
- for(subE = E1;...;...) S4
-|
- subE++
-|
- ++subE
-|
- --subE
-|
- subE--
-|
- &subE
-|
- E->f at p // bad use
-)
-  ... when any
-  return ...;
-}
-else S3
-
- at script:python depends on !context && !org && report@
-p << r.p;
-p1 << ifm.p1;
-x << ifm.E;
-@@
-
-msg="ERROR: %s is NULL but dereferenced." % (x)
-coccilib.report.print_report(p[0], msg)
-cocci.include_match(False)
-
- at script:python depends on !context && org && !report@
-p << r.p;
-p1 << ifm.p1;
-x << ifm.E;
-@@
-
-msg="ERROR: %s is NULL but dereferenced." % (x)
-msg_safe=msg.replace("[","@(").replace("]",")")
-cocci.print_main(msg_safe,p)
-cocci.include_match(False)
-
- at s depends on !context && (org || report) exists@
-expression subE <= ifm.E;
-expression *ifm.E;
-expression E1,E2;
-identifier f;
-statement S1,S2,S3,S4;
-iterator iter;
-position p!={pr1.p1,pr2.p2};
-position ifm.p1;
-@@
-
-if at p1 ((E == NULL && ...) || ...)
-{
-  ... when != if (...) S1 else S2
-(
- iter(subE,...) S4 // no use
-|
- list_remove_head(E2,subE,...)
-|
- subE = E1
-|
- for(subE = E1;...;...) S4
-|
- subE++
-|
- ++subE
-|
- --subE
-|
- subE--
-|
- &subE
-|
- E->f at p // bad use
-)
-  ... when any
-}
-else S3
-
- at script:python depends on !context && !org && report@
-p << s.p;
-p1 << ifm.p1;
-x << ifm.E;
-@@
-
-msg="ERROR: %s is NULL but dereferenced." % (x)
-coccilib.report.print_report(p[0], msg)
-
- at script:python depends on !context && org && !report@
-p << s.p;
-p1 << ifm.p1;
-x << ifm.E;
-@@
-
-msg="ERROR: %s is NULL but dereferenced." % (x)
-msg_safe=msg.replace("[","@(").replace("]",")")
-cocci.print_main(msg_safe,p)
-
-// For context mode
-
- at depends on context && !org && !report exists@
-expression subE <= ifm.E;
-expression *ifm.E;
-expression E1,E2;
-identifier f;
-statement S1,S2,S3,S4;
-iterator iter;
-position p!={pr1.p1,pr2.p2};
-position ifm.p1;
-@@
-
-if at p1 ((E == NULL && ...) || ...)
-{
-  ... when != if (...) S1 else S2
-(
- iter(subE,...) S4 // no use
-|
- list_remove_head(E2,subE,...)
-|
- subE = E1
-|
- for(subE = E1;...;...) S4
-|
- subE++
-|
- ++subE
-|
- --subE
-|
- subE--
-|
- &subE
-|
-* E->f at p // bad use
-)
-  ... when any
-  return ...;
-}
-else S3
-
-// The following three rules are duplicates of ifm, pr1 and pr2 respectively.
-// It is need because the previous rule as already made a "change".
-
- at ifm1@
-expression *E;
-statement S1,S2;
-position p1;
-@@
-
-if at p1 ((E == NULL && ...) || ...) S1 else S2
-
- at pr11 expression@
-expression *ifm1.E;
-identifier f;
-position p1;
-@@
-
- (E != NULL && ...) ? <+...E->f at p1...+> : ...
-
- at pr12 expression@
-expression *ifm1.E;
-identifier f;
-position p2;
-@@
-
-(
-  (E != NULL) && ... && <+...E->f at p2...+>
-|
-  (E == NULL) || ... || <+...E->f at p2...+>
-|
- sizeof(<+...E->f at p2...+>)
-)
-
- at depends on context && !org && !report exists@
-expression subE <= ifm1.E;
-expression *ifm1.E;
-expression E1,E2;
-identifier f;
-statement S1,S2,S3,S4;
-iterator iter;
-position p!={pr11.p1,pr12.p2};
-position ifm1.p1;
-@@
-
-if at p1 ((E == NULL && ...) || ...)
-{
-  ... when != if (...) S1 else S2
-(
- iter(subE,...) S4 // no use
-|
- list_remove_head(E2,subE,...)
-|
- subE = E1
-|
- for(subE = E1;...;...) S4
-|
- subE++
-|
- ++subE
-|
- --subE
-|
- subE--
-|
- &subE
-|
-* E->f at p // bad use
-)
-  ... when any
-}
-else S3
diff --git a/helpers/coccinelle/null/eno.cocci b/helpers/coccinelle/null/eno.cocci
deleted file mode 100644
index 9bd29aa..0000000
--- a/helpers/coccinelle/null/eno.cocci
+++ /dev/null
@@ -1,48 +0,0 @@
-/// The various basic memory allocation functions don't return ERR_PTR
-///
-// Confidence: High
-// 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:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at depends on patch@
-expression x,E;
-@@
-
-x = \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...)
-... when != x = E
-- IS_ERR(x)
-+ !x
-
- at r depends on !patch exists@
-expression x,E;
-position p1,p2;
-@@
-
-*x = \(kmalloc at p1\|kzalloc at p1\|kcalloc at p1\|kmem_cache_alloc at p1\|kmem_cache_zalloc at p1\|kmem_cache_alloc_node at p1\|kmalloc_node at p1\|kzalloc_node at p1\)(...)
-... when != x = E
-* IS_ERR at p2(x)
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("alloc call",p1)
-cocci.print_secs("IS_ERR that should be NULL tests",p2)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "ERROR: allocation function on line %s returns NULL not ERR_PTR on failure" % (p1[0].line)
-coccilib.report.print_report(p2[0], msg)
diff --git a/helpers/coccinelle/null/kmerr.cocci b/helpers/coccinelle/null/kmerr.cocci
deleted file mode 100644
index 5354a79..0000000
--- a/helpers/coccinelle/null/kmerr.cocci
+++ /dev/null
@@ -1,72 +0,0 @@
-/// This semantic patch looks for kmalloc etc that are not followed by a
-/// NULL check.  It only gives a report in the case where there is some
-/// error handling code later in the function, which may be helpful
-/// in determining what the error handling code for the call to kmalloc etc
-/// should be.
-///
-// Confidence: High
-// 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 context
-virtual org
-virtual report
-
- at withtest@
-expression x;
-position p;
-identifier f,fld;
-@@
-
-x at p = f(...);
-... when != x->fld
-\(x == NULL \| x != NULL\)
-
- at fixed depends on context && !org && !report@
-expression x,x1;
-position p1 != withtest.p;
-statement S;
-position any withtest.p;
-identifier f;
-@@
-
-*x at p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
-...
-*x1 at p = f(...);
-if (!x1) S
-
-// ------------------------------------------------------------------------
-
- at rfixed depends on (org || report) && !context exists@
-expression x,x1;
-position p1 != withtest.p;
-position p2;
-statement S;
-position any withtest.p;
-identifier f;
-@@
-
-x at p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
-...
-x1 at p = f at p2(...);
-if (!x1) S
-
- at script:python depends on org@
-p1 << rfixed.p1;
-p2 << rfixed.p2;
-@@
-
-cocci.print_main("alloc call",p1)
-cocci.print_secs("possible model",p2)
-
- at script:python depends on report@
-p1 << rfixed.p1;
-p2 << rfixed.p2;
-@@
-
-msg = "alloc with no test, possible model on line %s" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
diff --git a/helpers/coccinelle/tests/doublebitand.cocci b/helpers/coccinelle/tests/doublebitand.cocci
deleted file mode 100644
index 72f1572..0000000
--- a/helpers/coccinelle/tests/doublebitand.cocci
+++ /dev/null
@@ -1,54 +0,0 @@
-/// Find bit operations that include the same argument more than once
-//# One source of false positives is when the argument performs a side
-//# effect.  Another source of false positives is when a neutral value
-//# such as 0 for | is used to indicate no information, to maintain the
-//# same structure as other similar expressions
-///
-// Confidence: Moderate
-// 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 context
-virtual org
-virtual report
-
- at r expression@
-expression E;
-position p;
-@@
-
-(
-*        E at p
-         & ... & E
-|
-*        E at p
-         | ... | E
-|
-*        E at p
-         & ... & !E
-|
-*        E at p
-         | ... | !E
-|
-*        !E at p
-         & ... & E
-|
-*        !E at p
-         | ... | E
-)
-
- at script:python depends on org@
-p << r.p;
-@@
-
-cocci.print_main("duplicated argument to & or |",p)
-
- at script:python depends on report@
-p << r.p;
-@@
-
-coccilib.report.print_report(p[0],"duplicated argument to & or |")
diff --git a/helpers/coccinelle/tests/doubletest.cocci b/helpers/coccinelle/tests/doubletest.cocci
deleted file mode 100644
index 78d74c2..0000000
--- a/helpers/coccinelle/tests/doubletest.cocci
+++ /dev/null
@@ -1,40 +0,0 @@
-/// Find &&/|| operations that include the same argument more than once
-//# A common source of false positives is when the argument performs a side
-//# effect.
-///
-// Confidence: Moderate
-// 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 context
-virtual org
-virtual report
-
- at r expression@
-expression E;
-position p;
-@@
-
-(
-* E at p
-  || ... || E
-|
-* E at p
-  && ... && E
-)
-
- at script:python depends on org@
-p << r.p;
-@@
-
-cocci.print_main("duplicated argument to && or ||",p)
-
- at script:python depends on report@
-p << r.p;
-@@
-
-coccilib.report.print_report(p[0],"duplicated argument to && or ||")
diff --git a/helpers/coccinelle/tests/odd_ptr_err.cocci b/helpers/coccinelle/tests/odd_ptr_err.cocci
deleted file mode 100644
index cfe0a35..0000000
--- a/helpers/coccinelle/tests/odd_ptr_err.cocci
+++ /dev/null
@@ -1,65 +0,0 @@
-/// PTR_ERR should access the value just tested by IS_ERR
-//# There can be false positives in the patch case, where it is the call
-//# IS_ERR that is wrong.
-///
-// Confidence: High
-// Copyright: (C) 2012 Julia Lawall, INRIA.  GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
- at depends on patch@
-expression e,e1;
-@@
-
-(
-if (IS_ERR(e)) { ... PTR_ERR(e) ... }
-|
-if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
-|
-if (IS_ERR(e))
- { ...
-  PTR_ERR(
--   e1
-+   e
-  )
-   ... }
-)
-
- at r depends on !patch@
-expression e,e1;
-position p1,p2;
-@@
-
-(
-if (IS_ERR(e)) { ... PTR_ERR(e) ... }
-|
-if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
-|
-*if (IS_ERR at p1(e))
- { ...
-*  PTR_ERR at p2(e1)
-   ... }
-)
-
- at script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-cocci.print_main("inconsistent IS_ERR and PTR_ERR",p1)
-cocci.print_secs("PTR_ERR",p2)
-
- at script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
-@@
-
-msg = "inconsistent IS_ERR and PTR_ERR, PTR_ERR on line %s" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
-- 
1.8.5.2




More information about the aiaiai mailing list