Staging
v0.5.1
https://github.com/torvalds/linux
Raw File
Tip revision: d4e4ab86bcba5a72779c43dc1459f71fea3d89c8 authored by Linus Torvalds on 12 August 2013, 01:04:20 UTC
Linux 3.11-rc5
Tip revision: d4e4ab8
irqf_oneshot.cocci
/// Make sure threaded IRQs without a primary handler are always request with
/// IRQF_ONESHOT
///
//
// Confidence: Good
// Comments:
// Options: --no-includes

virtual patch
virtual context
virtual org
virtual report

@r1@
expression irq;
expression thread_fn;
expression flags;
position p;
@@
request_threaded_irq@p(irq, NULL, thread_fn,
(
flags | IRQF_ONESHOT
|
IRQF_ONESHOT
)
, ...)

@depends on patch@
expression irq;
expression thread_fn;
expression flags;
position p != r1.p;
@@
request_threaded_irq@p(irq, NULL, thread_fn,
(
-0
+IRQF_ONESHOT
|
-flags
+flags | IRQF_ONESHOT
)
, ...)

@depends on context@
position p != r1.p;
@@
*request_threaded_irq@p(...)

@match depends on report || org@
expression irq;
position p != r1.p;
@@
request_threaded_irq@p(irq, NULL, ...)

@script:python depends on org@
p << match.p;
@@
msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
coccilib.org.print_todo(p[0],msg)

@script:python depends on report@
p << match.p;
@@
msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
coccilib.report.print_report(p[0],msg)
back to top