xref: /linux/scripts/coccinelle/misc/irqf_oneshot.cocci (revision 0d456bad36d42d16022be045c8a53ddbb59ee478)
1/// Make sure threaded IRQs without a primary handler are always request with
2/// IRQF_ONESHOT
3///
4//
5// Confidence: Good
6// Comments:
7// Options: --no-includes
8
9virtual patch
10virtual context
11virtual org
12virtual report
13
14@r1@
15expression irq;
16expression thread_fn;
17expression flags;
18position p;
19@@
20request_threaded_irq@p(irq, NULL, thread_fn,
21(
22flags | IRQF_ONESHOT
23|
24IRQF_ONESHOT
25)
26, ...)
27
28@depends on patch@
29expression irq;
30expression thread_fn;
31expression flags;
32position p != r1.p;
33@@
34request_threaded_irq@p(irq, NULL, thread_fn,
35(
36-0
37+IRQF_ONESHOT
38|
39-flags
40+flags | IRQF_ONESHOT
41)
42, ...)
43
44@depends on context@
45position p != r1.p;
46@@
47*request_threaded_irq@p(...)
48
49@match depends on report || org@
50expression irq;
51position p != r1.p;
52@@
53request_threaded_irq@p(irq, NULL, ...)
54
55@script:python depends on org@
56p << match.p;
57@@
58msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
59coccilib.org.print_todo(p[0],msg)
60
61@script:python depends on report@
62p << match.p;
63@@
64msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
65coccilib.report.print_report(p[0],msg)
66