Release coccinelle-0.1
[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;
8expression E, E1, E2;
9statement 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 }