Release coccinelle-0.2.3rc3
[bpt/coccinelle.git] / parsing_cocci / tests / 5.cocci
CommitLineData
34e49164
C
1@@
2struct IsdnCard v;
3local function fn;
4@@
5
6v.irq_func = &fn;
7
8@@
9identifier intno, dev_id, regs;
10@@
11
12 fn(int intno, void *dev_id, struct pt_regs *regs) {
13 <...
14(
15- spin_lock(...);
16|
17- spin_unlock(...);
18)
19 ...>
20 }
21
22@@
23identifier cs;
24@@
25
26 fn(int intno, void *dev_id, struct pt_regs *regs) {
27 ...
28 struct IsdnCardState *cs = dev_id;
29+ spin_lock(&cs->lock);
30 ...
31?- if (!cs) { ... }
32 ...
33+ spin_unlock(&cs->lock);
34 return;
35 }