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