2019-11-19 21:46:03

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 0/4 v2] improve platform_get_irq.cocci

Various cleanups in platform_get_irq.cocci to give more useful
patches and to give a few more results.

v2: fix some interchanged From's and To's


2019-11-19 21:48:32

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 1/4 v2] coccinelle: platform_get_irq: simplify context case

Simplify to just report on the first dev_err, whereever it occurs.

Signed-off-by: Julia Lawall <[email protected]>

---
v2: no change

scripts/coccinelle/api/platform_get_irq.cocci | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/scripts/coccinelle/api/platform_get_irq.cocci b/scripts/coccinelle/api/platform_get_irq.cocci
index 06b6a95..c6ac755 100644
--- a/scripts/coccinelle/api/platform_get_irq.cocci
+++ b/scripts/coccinelle/api/platform_get_irq.cocci
@@ -23,16 +23,9 @@ platform_get_irq_byname

if ( \( ret < 0 \| ret <= 0 \) )
{
-(
-if (ret != -EPROBE_DEFER)
-{ ...
-*dev_err(...);
-... }
-|
...
*dev_err(...);
-)
-...
+... when any
}

@depends on patch@


2019-11-20 14:37:30

by Markus Elfring

[permalink] [raw]
Subject: Re: [PATCH 1/4 v2] coccinelle: platform_get_irq: simplify context case

> if ( \( ret < 0 \| ret <= 0 \) )

Can it make sense to specify the comparison by a constraint for
a metavariable of the type “binary operator” instead of a SmPL disjunction?

Regards,
Markus