Commit d05f94ad authored by Denis Efremov's avatar Denis Efremov Committed by Julia Lawall

coccinelle: api: filter out memdup_user definitions

Don't match memdup_user/vmemdup_user.
Signed-off-by: default avatarDenis Efremov <efremov@linux.com>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
parent 9c568dbd
...@@ -15,12 +15,20 @@ virtual context ...@@ -15,12 +15,20 @@ virtual context
virtual org virtual org
virtual report virtual report
@initialize:python@
@@
filter = frozenset(['memdup_user', 'vmemdup_user'])
def relevant(p):
return not (filter & {el.current_element for el in p})
@depends on patch@ @depends on patch@
expression from,to,size; expression from,to,size;
identifier l1,l2; identifier l1,l2;
position p : script:python() { relevant(p) };
@@ @@
- to = \(kmalloc\|kzalloc\) - to = \(kmalloc@p\|kzalloc@p\)
- (size,\(GFP_KERNEL\|GFP_USER\| - (size,\(GFP_KERNEL\|GFP_USER\|
- \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\)); - \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\));
+ to = memdup_user(from,size); + to = memdup_user(from,size);
...@@ -42,9 +50,10 @@ identifier l1,l2; ...@@ -42,9 +50,10 @@ identifier l1,l2;
@depends on patch@ @depends on patch@
expression from,to,size; expression from,to,size;
identifier l1,l2; identifier l1,l2;
position p : script:python() { relevant(p) };
@@ @@
- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); - to = \(kvmalloc@p\|kvzalloc@p\)(size,\(GFP_KERNEL\|GFP_USER\));
+ to = vmemdup_user(from,size); + to = vmemdup_user(from,size);
if ( if (
- to==NULL - to==NULL
...@@ -63,7 +72,7 @@ identifier l1,l2; ...@@ -63,7 +72,7 @@ identifier l1,l2;
@r depends on !patch@ @r depends on !patch@
expression from,to,size; expression from,to,size;
position p; position p : script:python() { relevant(p) };
statement S1,S2; statement S1,S2;
@@ @@
...@@ -76,7 +85,7 @@ statement S1,S2; ...@@ -76,7 +85,7 @@ statement S1,S2;
@rv depends on !patch@ @rv depends on !patch@
expression from,to,size; expression from,to,size;
position p; position p : script:python() { relevant(p) };
statement S1,S2; statement S1,S2;
@@ @@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment