aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentin Rothberg <valentinrothberg@gmail.com>2015-03-04 03:32:32 -0500
committerMichal Marek <mmarek@suse.cz>2015-03-25 06:58:10 -0400
commit2c2b913d19e149bf7c4ae5f62634fc3b46a06306 (patch)
treead87dd239b67c04f8b78533062166c215d52d2be
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
irqf_oneshot.cocci: add check of devm_request_threaded_irq()
Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. Until now, this coccinelle script only checked request_threaded_irq(). However, the counterpart devm function (see kernel/irq/devres.c) is also affected by the missing flag which can be detected with this patch. Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--scripts/coccinelle/misc/irqf_oneshot.cocci24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci b/scripts/coccinelle/misc/irqf_oneshot.cocci
index 6cfde94be0ef..a24a754ae1d7 100644
--- a/scripts/coccinelle/misc/irqf_oneshot.cocci
+++ b/scripts/coccinelle/misc/irqf_oneshot.cocci
@@ -12,11 +12,13 @@ virtual org
12virtual report 12virtual report
13 13
14@r1@ 14@r1@
15expression dev;
15expression irq; 16expression irq;
16expression thread_fn; 17expression thread_fn;
17expression flags; 18expression flags;
18position p; 19position p;
19@@ 20@@
21(
20request_threaded_irq@p(irq, NULL, thread_fn, 22request_threaded_irq@p(irq, NULL, thread_fn,
21( 23(
22flags | IRQF_ONESHOT 24flags | IRQF_ONESHOT
@@ -24,13 +26,24 @@ flags | IRQF_ONESHOT
24IRQF_ONESHOT 26IRQF_ONESHOT
25) 27)
26, ...) 28, ...)
29|
30devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
31(
32flags | IRQF_ONESHOT
33|
34IRQF_ONESHOT
35)
36, ...)
37)
27 38
28@depends on patch@ 39@depends on patch@
40expression dev;
29expression irq; 41expression irq;
30expression thread_fn; 42expression thread_fn;
31expression flags; 43expression flags;
32position p != r1.p; 44position p != r1.p;
33@@ 45@@
46(
34request_threaded_irq@p(irq, NULL, thread_fn, 47request_threaded_irq@p(irq, NULL, thread_fn,
35( 48(
36-0 49-0
@@ -40,6 +53,17 @@ request_threaded_irq@p(irq, NULL, thread_fn,
40+flags | IRQF_ONESHOT 53+flags | IRQF_ONESHOT
41) 54)
42, ...) 55, ...)
56|
57devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
58(
59-0
60+IRQF_ONESHOT
61|
62-flags
63+flags | IRQF_ONESHOT
64)
65, ...)
66)
43 67
44@depends on context@ 68@depends on context@
45position p != r1.p; 69position p != r1.p;