Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / parsing_cocci / test2.cocci
1 @@
2 struct SHT sht;
3 local function proc_info_func;
4 @@
5 sht.proc_info = proc_info_func;
6
7 @@
8 identifier buffer, start, offset, length, inout, hostptr, hostno;
9 @@
10 proc_info_func (
11 + struct Scsi_Host *hostptr,
12 char *buffer, char **start, off_t offset, int length,
13 - int hostno,
14 int inout) {
15 ...
16 - struct Scsi_Host *hostptr;
17 ...
18 - hostptr = scsi_host_hn_get(hostno);
19 ...
20 ?- if (!hostptr) { ... }
21 ...
22 ?- scsi_host_put(hostptr);
23 ...
24 }
25
26 @@
27 expression E;
28 @@
29 proc_info_func(...) {
30 <...
31 (
32 \+- E->host_no == hostno
33 + E == shpnt
34 |
35 - hostno
36 + shpnt->host_no
37 )
38 ...>
39 }