[Cocci] [PATCH 1/4 v2] coccinelle: platform_get_irq: simplify context case

2019-11-19 Thread Julia Lawall
Simplify to just report on the first dev_err, whereever it occurs. Signed-off-by: Julia Lawall --- 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

[Cocci] [PATCH 3/4 v2] coccinelle: platform_get_irq: allow multiple dev_errs

2019-11-19 Thread Julia Lawall
Allow multiple calls to dev_err in the if branch under the call to the platform_get_irq function. Remove only the first one. Signed-off-by: Julia Lawall --- v2: no change scripts/coccinelle/api/platform_get_irq.cocci |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrip

[Cocci] [PATCH 4/4 v2] coccinelle: platform_get_irq: drop unneeded metavariable

2019-11-19 Thread Julia Lawall
Having E as a metavariable adds the requirement to verify its type. This seems like an unnecessary constraint, so drop it. There is currently no impact on the set of results. Signed-off-by: Julia Lawall --- v2: fix From and To (very sorry for the mistake) scripts/coccinelle/api/platform_get_ir

[Cocci] [PATCH 0/4 v2] improve platform_get_irq.cocci

2019-11-19 Thread Julia Lawall
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 ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

[Cocci] [PATCH 2/4 v2] coccinelle: platform_get_irq: handle 2-statement branches

2019-11-19 Thread Julia Lawall
Treat separately the case where there is only one other statement in the branch, to be able to remove the outer {} as well. Signed-off-by: Julia Lawall --- v2: fix From and To (very sorry for the mistake) scripts/coccinelle/api/platform_get_irq.cocci | 19 +++ 1 file changed,

Re: [Cocci] [PATCH 2/4] coccinelle: platform_get_irq: handle 2-statement branches

2019-11-19 Thread Julia Lawall
On Tue, 19 Nov 2019, Markus Elfring wrote: > > From: Masahiro Yamada > > I wonder about this information. > Would you like to use the tag “Suggested-by” instead? Sorry, I seem to have done something quite wrong on this patch. I will fix it. > > > … > > +++ b/scripts/coccinelle/api/platform_g

Re: [Cocci] [PATCH 2/4] coccinelle: platform_get_irq: handle 2-statement branches

2019-11-19 Thread Markus Elfring
> From: Masahiro Yamada I wonder about this information. Would you like to use the tag “Suggested-by” instead? … > +++ b/scripts/coccinelle/api/platform_get_irq.cocci > @@ -31,6 +31,25 @@ if ( \( ret < 0 \| ret <= 0 \) ) … > +ret = > +( > +platform_get_irq > +| > +platform_get_irq_byname > +)(E

Re: [Cocci] [PATCH 2/4] coccinelle: platform_get_irq: handle 2-statement branches

2019-11-19 Thread Markus Elfring
> From: Masahiro Yamada I wonder about this information. Would you like to use the tag “Suggested-by” instead? … > +++ b/scripts/coccinelle/api/platform_get_irq.cocci > @@ -31,6 +31,25 @@ if ( \( ret < 0 \| ret <= 0 \) ) … > +ret = > +( > +platform_get_irq > +| > +platform_get_irq_byname > +)(E

[Cocci] [PATCH 4/4] coccinelle: platform_get_irq: drop unneeded metavariable

2019-11-19 Thread Julia Lawall
From: Masahiro Yamada Having E as a metavariable adds the requirement to verify its type. This seems like an unnecessary constraint, so drop it. There is currently no impact on the set of results. Signed-off-by: Julia Lawall --- scripts/coccinelle/api/platform_get_irq.cocci | 12 ---

[Cocci] [PATCH 0/4] improve platform_get_irq.cocci

2019-11-19 Thread Julia Lawall
Various cleanups in platform_get_irq.cocci to give more useful patches and to give a few more results. ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

[Cocci] [PATCH 1/4] coccinelle: platform_get_irq: simplify context case

2019-11-19 Thread Julia Lawall
Simplify to just report on the first dev_err, whereever it occurs. Signed-off-by: Julia Lawall --- 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

[Cocci] [PATCH 3/4] coccinelle: platform_get_irq: allow multiple dev_errs

2019-11-19 Thread Julia Lawall
Allow multiple calls to dev_err in the if branch under the call to the platform_get_irq function. Remove only the first one. Signed-off-by: Julia Lawall --- scripts/coccinelle/api/platform_get_irq.cocci |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccinelle/a

[Cocci] [PATCH 2/4] coccinelle: platform_get_irq: handle 2-statement branches

2019-11-19 Thread Julia Lawall
From: Masahiro Yamada Treat separately the case where there is only one other statement in the branch, to be able to remove the outer {} as well. Signed-off-by: Julia Lawall --- scripts/coccinelle/api/platform_get_irq.cocci | 19 +++ 1 file changed, 19 insertions(+) diff --

[Cocci] [PATCH] Coccinelle: ptr_ret: drop PTR_ERR_OR_ZERO semantic patch

2019-11-19 Thread Julia Lawall
This mostly made changes that made the code harder to read, so drop it. Signed-off-by: Julia Lawall --- scripts/coccinelle/api/ptr_ret.cocci | 97 --- 1 file changed, 97 deletions(-) diff --git a/scripts/coccinelle/api/ptr_ret.cocci b/scripts/coccinelle/api/p

[Cocci] [PATCH] parsing_c: handle space and ctx newline around minus toks

2019-11-19 Thread Jaskaran Singh
Handle the following case: space + minus + context newline In this case, the space should be dropped except if it is followed by any newline. This should be done just before the minus tokens are removed from the token stream. This is useful for situations like the following. Here, the sp