Coccinelle release 0.2.5-rc3
[bpt/coccinelle.git] / tests / video.cocci
CommitLineData
34e49164
C
1@@
2local function ioctlfn;
3identifier dev, cmd, arg;
4//fresh identifier i, f;
5identifier v;
6type T;
7identifier fld;
faf9a90c 8expression E1, E2;
34e49164
C
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 }