1
0
Fork 0

irqf_oneshot.cocci: add check of devm_request_threaded_irq()

Since commit 1c6c69525b ("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>
hifive-unleashed-5.1
Valentin Rothberg 2015-03-04 09:32:32 +01:00 committed by Michal Marek
parent c517d838eb
commit 2c2b913d19
1 changed files with 24 additions and 0 deletions

View File

@ -12,11 +12,13 @@ virtual org
virtual report
@r1@
expression dev;
expression irq;
expression thread_fn;
expression flags;
position p;
@@
(
request_threaded_irq@p(irq, NULL, thread_fn,
(
flags | IRQF_ONESHOT
@ -24,13 +26,24 @@ flags | IRQF_ONESHOT
IRQF_ONESHOT
)
, ...)
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
(
flags | IRQF_ONESHOT
|
IRQF_ONESHOT
)
, ...)
)
@depends on patch@
expression dev;
expression irq;
expression thread_fn;
expression flags;
position p != r1.p;
@@
(
request_threaded_irq@p(irq, NULL, thread_fn,
(
-0
@ -40,6 +53,17 @@ request_threaded_irq@p(irq, NULL, thread_fn,
+flags | IRQF_ONESHOT
)
, ...)
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
(
-0
+IRQF_ONESHOT
|
-flags
+flags | IRQF_ONESHOT
)
, ...)
)
@depends on context@
position p != r1.p;