Release coccinelle-0.1.1
[bpt/coccinelle.git] / tests / video.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 expression E, E1, E2;
9 statement S;
10 @@
11
12 ioctlfn(
13 - struct video_device *dev,
14 + struct inode *i, struct file *f,
15 unsigned int cmd, void *arg) {
16 <...
17 - T v;
18 + T *v;
19 ...
20 - if (copy_from_user(&v,arg,sizeof(v)) != 0) return E1;
21 <...
22 - v.fld
23 + v->fld
24 ...>
25 ?- if (copy_to_user(arg,&v,sizeof(v))) return E2;
26 ...>
27 }