Debian Codegraph @

demos/demo_rule9/rule9_3.cocci

raw
1 @ rule1 @
2 typedef Scsi_Host_Template;
3 {struct SHT, Scsi_Host_Template} fops;
4 identifier proc_info_func;
5 @@
6 fops.proc_info = proc_info_func;
7
8 @@
9 identifier rule1.proc_info_func;
10 identifier buffer, start, offset, length, inout, hostno;
11 identifier hostptr;
12 typedef off_t;
13 @@
14 proc_info_func (
15 + struct Scsi_Host *hostptr,
16 char *buffer, char **start, off_t offset, int length,
17 - int hostno,
18 int inout) {
19 ...
20 - struct Scsi_Host *hostptr;
21 ...
22 - hostptr = scsi_host_hn_get(hostno);
23 ...
24 ?- if (!hostptr) { ... return ...; }
25 ...
26 ?- scsi_host_put(hostptr);
27 ...
28 }