Release coccinelle-0.1.4
[bpt/coccinelle.git] / tests / video1.cocci
1 @@
2 local function ioctlfn;
3 identifier dev, cmd, arg;
4 //fresh identifier i, f;
5 identifier v;
6 type T;
7 identifier fld;
8 @@
9
10 ioctlfn(
11 struct video_device *dev,
12 unsigned int cmd, void *arg) {
13 <...
14 - T v;
15 + T *v;
16 ...
17 (
18 - if (copy_from_user(&v,arg,sizeof(v)) != 0) return ...;
19 |
20 - if (copy_from_user(&v,arg,sizeof(v))) return ...;
21 )
22 <...
23 - v.fld
24 + v->fld
25 ...>
26 ?- if (copy_to_user(arg,&v,sizeof(v))) return ...;
27 ...>
28 }