mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-14 06:35:12 +00:00
dca24c4544
Currently because of the left associativity of the operators, pattern IRQF_ONESHOT | flags does not match with the pattern when we have more than one flag after the disjunction. This eventually results in giving false positives by the script. This patch eliminates these FPs by improving the rule. Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Signed-off-by: Michal Marek <mmarek@suse.com>
102 lines
1.7 KiB
Text
102 lines
1.7 KiB
Text
/// Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
|
|
/// threaded IRQs without a primary handler need to be requested with
|
|
/// IRQF_ONESHOT, otherwise the request will fail.
|
|
///
|
|
/// So pass the IRQF_ONESHOT flag in this case.
|
|
///
|
|
//
|
|
// Confidence: Good
|
|
// Comments:
|
|
// Options: --no-includes
|
|
|
|
virtual patch
|
|
virtual context
|
|
virtual org
|
|
virtual report
|
|
|
|
@r1@
|
|
expression dev, irq, thread_fn;
|
|
position p;
|
|
@@
|
|
(
|
|
request_threaded_irq@p(irq, NULL, thread_fn,
|
|
(
|
|
IRQF_ONESHOT | ...
|
|
|
|
|
IRQF_ONESHOT
|
|
)
|
|
, ...)
|
|
|
|
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
|
|
(
|
|
IRQF_ONESHOT | ...
|
|
|
|
|
IRQF_ONESHOT
|
|
)
|
|
, ...)
|
|
)
|
|
|
|
@r2@
|
|
expression dev, irq, thread_fn, flags, e;
|
|
position p != r1.p;
|
|
@@
|
|
(
|
|
flags = IRQF_ONESHOT | ...
|
|
|
|
|
flags |= IRQF_ONESHOT | ...
|
|
)
|
|
... when != flags = e
|
|
(
|
|
request_threaded_irq@p(irq, NULL, thread_fn, flags, ...);
|
|
|
|
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, flags, ...);
|
|
)
|
|
|
|
@depends on patch@
|
|
expression dev, irq, thread_fn, flags;
|
|
position p != {r1.p,r2.p};
|
|
@@
|
|
(
|
|
request_threaded_irq@p(irq, NULL, thread_fn,
|
|
(
|
|
-0
|
|
+IRQF_ONESHOT
|
|
|
|
|
-flags
|
|
+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,r2.p};
|
|
@@
|
|
*request_threaded_irq@p(...)
|
|
|
|
@match depends on report || org@
|
|
expression irq;
|
|
position p != {r1.p,r2.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)
|