Skip to content
Snippets Groups Projects
Commit dca24c45 authored by Vaishali Thakkar's avatar Vaishali Thakkar Committed by Michal Marek
Browse files

Coccinelle: misc: Improve the matching of rules


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: default avatarVaishali Thakkar <vaishali.thakkar@oracle.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
parent 51a5f810
No related branches found
No related tags found
No related merge requests found
...@@ -15,16 +15,13 @@ virtual org ...@@ -15,16 +15,13 @@ virtual org
virtual report virtual report
@r1@ @r1@
expression dev; expression dev, irq, thread_fn;
expression irq;
expression thread_fn;
expression flags;
position p; position p;
@@ @@
( (
request_threaded_irq@p(irq, NULL, thread_fn, request_threaded_irq@p(irq, NULL, thread_fn,
( (
flags | IRQF_ONESHOT IRQF_ONESHOT | ...
| |
IRQF_ONESHOT IRQF_ONESHOT
) )
...@@ -32,21 +29,34 @@ IRQF_ONESHOT ...@@ -32,21 +29,34 @@ IRQF_ONESHOT
| |
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
( (
flags | IRQF_ONESHOT IRQF_ONESHOT | ...
| |
IRQF_ONESHOT IRQF_ONESHOT
) )
, ...) , ...)
) )
@depends on patch@ @r2@
expression dev; expression dev, irq, thread_fn, flags, e;
expression irq;
expression thread_fn;
expression flags;
position p != r1.p; 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, request_threaded_irq@p(irq, NULL, thread_fn,
( (
-0 -0
...@@ -69,13 +79,13 @@ devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, ...@@ -69,13 +79,13 @@ devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
) )
@depends on context@ @depends on context@
position p != r1.p; position p != {r1.p,r2.p};
@@ @@
*request_threaded_irq@p(...) *request_threaded_irq@p(...)
@match depends on report || org@ @match depends on report || org@
expression irq; expression irq;
position p != r1.p; position p != {r1.p,r2.p};
@@ @@
request_threaded_irq@p(irq, NULL, ...) request_threaded_irq@p(irq, NULL, ...)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment