Release coccinelle-0.1.1
[bpt/coccinelle.git] / tests / request_irq.cocci
CommitLineData
34e49164
C
1@ rule1 @
2@@
3
4#include <linux/interrupt.h>
5
6// --------------------------------------------------------------
7// do some cleaup first.
8// we should specify that these rules only apply to files in the directory
9// arch/v850/kernel
10
11@@
12int E;
13struct pt_regs *regs;
14@@
15
16(
17- handle_irq(E,regs)
18+ handle_irq(E)
19|
20- __do_IRQ(E,regs)
21+ __do_IRQ(E)
22)
23
24@@
25identifier irq, regs;
26@@
27
28 unsigned int
29- handle_irq (int irq, struct pt_regs *regs)
30+ handle_irq (int irq)
31 {
32 ... when != regs
33 }
34
35// --------------------------------------------------------------
36// now the real transformation
37
38@ rule2 depends on rule1 @
39expression irq;
40identifier handler;
41expression irqflags;
42expression devname;
43expression dev_id;
44@@
45
46request_irq(irq, handler, irqflags, devname, dev_id)
47
48@@
49typedef irqreturn_t;
50identifier rule2.handler, irq, dev, regs;
51@@
52
53 static irqreturn_t
54- handler(int irq, void *dev, struct pt_regs *regs)
55+ handler(int irq, void *dev)
56 {
57 ... when != regs
58 }
59
60@@
61identifier rule2.handler;
62expression E1, E2;
63@@
64
65handler(E1,E2
66- ,NULL
67 )
68
69@@
70identifier rule2.handler;
71expression E1, E2, E3;
72@@
73
74handler(E1,E2,
75- E3
76+ NEED_TO_CHECK_THIS_USE_OF(E3)
77 )