diff options
author | Valentin Rothberg <valentinrothberg@gmail.com> | 2015-03-04 03:32:32 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2015-03-25 06:58:10 -0400 |
commit | 2c2b913d19e149bf7c4ae5f62634fc3b46a06306 (patch) | |
tree | ad87dd239b67c04f8b78533062166c215d52d2be | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (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.cocci | 24 |
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 | |||
12 | virtual report | 12 | virtual report |
13 | 13 | ||
14 | @r1@ | 14 | @r1@ |
15 | expression dev; | ||
15 | expression irq; | 16 | expression irq; |
16 | expression thread_fn; | 17 | expression thread_fn; |
17 | expression flags; | 18 | expression flags; |
18 | position p; | 19 | position p; |
19 | @@ | 20 | @@ |
21 | ( | ||
20 | request_threaded_irq@p(irq, NULL, thread_fn, | 22 | request_threaded_irq@p(irq, NULL, thread_fn, |
21 | ( | 23 | ( |
22 | flags | IRQF_ONESHOT | 24 | flags | IRQF_ONESHOT |
@@ -24,13 +26,24 @@ flags | IRQF_ONESHOT | |||
24 | IRQF_ONESHOT | 26 | IRQF_ONESHOT |
25 | ) | 27 | ) |
26 | , ...) | 28 | , ...) |
29 | | | ||
30 | devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, | ||
31 | ( | ||
32 | flags | IRQF_ONESHOT | ||
33 | | | ||
34 | IRQF_ONESHOT | ||
35 | ) | ||
36 | , ...) | ||
37 | ) | ||
27 | 38 | ||
28 | @depends on patch@ | 39 | @depends on patch@ |
40 | expression dev; | ||
29 | expression irq; | 41 | expression irq; |
30 | expression thread_fn; | 42 | expression thread_fn; |
31 | expression flags; | 43 | expression flags; |
32 | position p != r1.p; | 44 | position p != r1.p; |
33 | @@ | 45 | @@ |
46 | ( | ||
34 | request_threaded_irq@p(irq, NULL, thread_fn, | 47 | request_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 | | | ||
57 | devm_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@ |
45 | position p != r1.p; | 69 | position p != r1.p; |