diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/coccinelle/misc/irqf_oneshot.cocci | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci b/scripts/coccinelle/misc/irqf_oneshot.cocci new file mode 100644 index 000000000000..6cfde94be0ef --- /dev/null +++ b/scripts/coccinelle/misc/irqf_oneshot.cocci | |||
| @@ -0,0 +1,65 @@ | |||
| 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 | |||
| 9 | virtual patch | ||
| 10 | virtual context | ||
| 11 | virtual org | ||
| 12 | virtual report | ||
| 13 | |||
| 14 | @r1@ | ||
| 15 | expression irq; | ||
| 16 | expression thread_fn; | ||
| 17 | expression flags; | ||
| 18 | position p; | ||
| 19 | @@ | ||
| 20 | request_threaded_irq@p(irq, NULL, thread_fn, | ||
| 21 | ( | ||
| 22 | flags | IRQF_ONESHOT | ||
| 23 | | | ||
| 24 | IRQF_ONESHOT | ||
| 25 | ) | ||
| 26 | , ...) | ||
| 27 | |||
| 28 | @depends on patch@ | ||
| 29 | expression irq; | ||
| 30 | expression thread_fn; | ||
| 31 | expression flags; | ||
| 32 | position p != r1.p; | ||
| 33 | @@ | ||
| 34 | request_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@ | ||
| 45 | position p != r1.p; | ||
| 46 | @@ | ||
| 47 | *request_threaded_irq@p(...) | ||
| 48 | |||
| 49 | @match depends on report || org@ | ||
| 50 | expression irq; | ||
| 51 | position p != r1.p; | ||
| 52 | @@ | ||
| 53 | request_threaded_irq@p(irq, NULL, ...) | ||
| 54 | |||
| 55 | @script:python depends on org@ | ||
| 56 | p << match.p; | ||
| 57 | @@ | ||
| 58 | msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" | ||
| 59 | coccilib.org.print_todo(p[0],msg) | ||
| 60 | |||
| 61 | @script:python depends on report@ | ||
| 62 | p << match.p; | ||
| 63 | @@ | ||
| 64 | msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" | ||
| 65 | coccilib.report.print_report(p[0],msg) | ||
