permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / video_usercopy.cocci
1 // - if(copy_from_user(&x, arg)) does not work.
2 // the if-isomorphism does not work :(
3
4 @@
5 type T;
6 identifier x, fld;
7 function ioctl; // should be caracterised by another rule
8 @@
9
10
11 ioctl(..., void *arg, ...) {
12 <...
13 - T x;
14 + T *x = arg;
15 ...
16 - if(copy_from_user(&x, arg)!=0)
17 - { ... return ...; }
18 <...
19 (
20 - x.fld
21 + x->fld
22 |
23 - &x
24 + x
25 )
26 ...>
27 - if(copy_to_user(arg, &x))
28 - { ... return ...; }
29 ...>
30 }