1/// Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") 2/// threaded IRQs without a primary handler need to be requested with 3/// IRQF_ONESHOT, otherwise the request will fail. 4/// 5/// So pass the IRQF_ONESHOT flag in this case. 6/// 7// 8// Confidence: Good 9// Comments: 10// Options: --no-includes 11 12virtual patch 13virtual context 14virtual org 15virtual report 16 17@r1@ 18expression dev; 19expression irq; 20expression thread_fn; 21expression flags; 22position p; 23@@ 24( 25request_threaded_irq@p(irq, NULL, thread_fn, 26( 27flags | IRQF_ONESHOT 28| 29IRQF_ONESHOT 30) 31, ...) 32| 33devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, 34( 35flags | IRQF_ONESHOT 36| 37IRQF_ONESHOT 38) 39, ...) 40) 41 42@depends on patch@ 43expression dev; 44expression irq; 45expression thread_fn; 46expression flags; 47position p != r1.p; 48@@ 49( 50request_threaded_irq@p(irq, NULL, thread_fn, 51( 52-0 53+IRQF_ONESHOT 54| 55-flags 56+flags | IRQF_ONESHOT 57) 58, ...) 59| 60devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, 61( 62-0 63+IRQF_ONESHOT 64| 65-flags 66+flags | IRQF_ONESHOT 67) 68, ...) 69) 70 71@depends on context@ 72position p != r1.p; 73@@ 74*request_threaded_irq@p(...) 75 76@match depends on report || org@ 77expression irq; 78position p != r1.p; 79@@ 80request_threaded_irq@p(irq, NULL, ...) 81 82@script:python depends on org@ 83p << match.p; 84@@ 85msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" 86coccilib.org.print_todo(p[0],msg) 87 88@script:python depends on report@ 89p << match.p; 90@@ 91msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" 92coccilib.report.print_report(p[0],msg) 93