Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error
@ 2019-09-06  3:30 YueHaibing
  2019-09-06  5:09 ` Julia Lawall
  2019-09-06  5:15 ` Stephen Boyd
  0 siblings, 2 replies; 5+ messages in thread
From: YueHaibing @ 2019-09-06  3:30 UTC (permalink / raw)
  To: Julia.Lawall, Gilles.Muller, nicolas.palix, michal.lkml, gregkh,
	swboyd, yuehaibing
  Cc: cocci, linux-kernel

When do coccicheck, I get this error:

spatch -D report --no-show-diff --very-quiet --cocci-file
./scripts/coccinelle/api/platform_get_irq.cocci --include-headers
--dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include
 -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi
 -I ./include/uapi -I ./include/generated/uapi
 --include ./include/linux/kconfig.h --jobs 192 --chunksize 1
minus: parse error:
  File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
  around = '\(',
  whole content = if ( ret \( < \| <= \) 0 )

In commit e56476897448 ("fpga: Remove dev_err() usage
after platform_get_irq()") log, I found the semantic patch,
it fix this issue.

Fixes: 98051ba2b28b ("coccinelle: Add script to check for platform_get_irq() excessive prints")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 scripts/coccinelle/api/platform_get_irq.cocci | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/coccinelle/api/platform_get_irq.cocci b/scripts/coccinelle/api/platform_get_irq.cocci
index f6e1afc..06b6a95 100644
--- a/scripts/coccinelle/api/platform_get_irq.cocci
+++ b/scripts/coccinelle/api/platform_get_irq.cocci
@@ -21,7 +21,7 @@ platform_get_irq
 platform_get_irq_byname
 )(E, ...);
 
-if ( ret \( < \| <= \) 0 )
+if ( \( ret < 0 \| ret <= 0 \) )
 {
 (
 if (ret != -EPROBE_DEFER)
@@ -47,7 +47,7 @@ platform_get_irq
 platform_get_irq_byname
 )(E, ...);
 
-if ( ret \( < \| <= \) 0 )
+if ( \( ret < 0 \| ret <= 0 \) )
 {
 (
 -if (ret != -EPROBE_DEFER)
@@ -74,7 +74,7 @@ platform_get_irq
 platform_get_irq_byname
 )(E, ...);
 
-if ( ret \( < \| <= \) 0 )
+if ( \( ret < 0 \| ret <= 0 \) )
 {
 (
 if (ret != -EPROBE_DEFER)
-- 
2.7.4


_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error
  2019-09-06  3:30 [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error YueHaibing
@ 2019-09-06  5:09 ` Julia Lawall
  2019-09-06  5:15 ` Stephen Boyd
  1 sibling, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2019-09-06  5:09 UTC (permalink / raw)
  To: YueHaibing
  Cc: michal.lkml, gregkh, nicolas.palix, linux-kernel, swboyd, cocci



On Fri, 6 Sep 2019, YueHaibing wrote:

> When do coccicheck, I get this error:
>
> spatch -D report --no-show-diff --very-quiet --cocci-file
> ./scripts/coccinelle/api/platform_get_irq.cocci --include-headers
> --dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include
>  -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi
>  -I ./include/uapi -I ./include/generated/uapi
>  --include ./include/linux/kconfig.h --jobs 192 --chunksize 1
> minus: parse error:
>   File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
>   around = '\(',
>   whole content = if ( ret \( < \| <= \) 0 )
>
> In commit e56476897448 ("fpga: Remove dev_err() usage
> after platform_get_irq()") log, I found the semantic patch,
> it fix this issue.

Thanks very much for reporting the problem.

Acked-by: Julia Lawall <julia.lawall@lip6.fr>


>
> Fixes: 98051ba2b28b ("coccinelle: Add script to check for platform_get_irq() excessive prints")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  scripts/coccinelle/api/platform_get_irq.cocci | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/coccinelle/api/platform_get_irq.cocci b/scripts/coccinelle/api/platform_get_irq.cocci
> index f6e1afc..06b6a95 100644
> --- a/scripts/coccinelle/api/platform_get_irq.cocci
> +++ b/scripts/coccinelle/api/platform_get_irq.cocci
> @@ -21,7 +21,7 @@ platform_get_irq
>  platform_get_irq_byname
>  )(E, ...);
>
> -if ( ret \( < \| <= \) 0 )
> +if ( \( ret < 0 \| ret <= 0 \) )
>  {
>  (
>  if (ret != -EPROBE_DEFER)
> @@ -47,7 +47,7 @@ platform_get_irq
>  platform_get_irq_byname
>  )(E, ...);
>
> -if ( ret \( < \| <= \) 0 )
> +if ( \( ret < 0 \| ret <= 0 \) )
>  {
>  (
>  -if (ret != -EPROBE_DEFER)
> @@ -74,7 +74,7 @@ platform_get_irq
>  platform_get_irq_byname
>  )(E, ...);
>
> -if ( ret \( < \| <= \) 0 )
> +if ( \( ret < 0 \| ret <= 0 \) )
>  {
>  (
>  if (ret != -EPROBE_DEFER)
> --
> 2.7.4
>
>
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error
  2019-09-06  3:30 [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error YueHaibing
  2019-09-06  5:09 ` Julia Lawall
@ 2019-09-06  5:15 ` Stephen Boyd
  2019-09-06  6:52   ` Markus Elfring
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2019-09-06  5:15 UTC (permalink / raw)
  To: Gilles.Muller, Julia.Lawall, gregkh, michal.lkml, nicolas.palix,
	yuehaibing
  Cc: cocci, linux-kernel

Quoting YueHaibing (2019-09-05 20:30:06)
> When do coccicheck, I get this error:
> 
> spatch -D report --no-show-diff --very-quiet --cocci-file
> ./scripts/coccinelle/api/platform_get_irq.cocci --include-headers
> --dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include
>  -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi
>  -I ./include/uapi -I ./include/generated/uapi
>  --include ./include/linux/kconfig.h --jobs 192 --chunksize 1
> minus: parse error:
>   File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
>   around = '\(',
>   whole content = if ( ret \( < \| <= \) 0 )
> 
> In commit e56476897448 ("fpga: Remove dev_err() usage
> after platform_get_irq()") log, I found the semantic patch,
> it fix this issue.
> 
> Fixes: 98051ba2b28b ("coccinelle: Add script to check for platform_get_irq() excessive prints")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---

Hmm I had this earlier but someone asked me to change it.

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error
  2019-09-06  6:52   ` Markus Elfring
@ 2019-09-06  6:59     ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2019-09-06  6:59 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Rob Herring, Michal Marek, Bartlomiej Zolnierkiewicz, YueHaibing,
	Nicolas Palix, kernel-janitors, linux-kernel, Stephen Boyd,
	Andrzej Hajda, Andy Shevchenko, Mark Brown, Greg Kroah-Hartman,
	Javier Martinez Canillas, cocci, Russell King, Marek Szyprowski



On Fri, 6 Sep 2019, Markus Elfring wrote:

> > > minus: parse error:
> > >   File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
> > >   around = '\(',
> > >   whole content = if ( ret \( < \| <= \) 0 )
> > >
> > > In commit e56476897448 ("fpga: Remove dev_err() usage
> > > after platform_get_irq()") log, I found the semantic patch,
> > > it fix this issue.
> > >
> > > Fixes: 98051ba2b28b ("coccinelle: Add script to check for platform_get_irq() excessive prints")
> > > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > > ---
> >
> > Hmm I had this earlier but someone asked me to change it.
>
> I proposed something also during the development for this SmPL script.
> https://lkml.org/lkml/2019/7/24/274
> https://lore.kernel.org/r/c98b8f50-1adf-ea95-a91c-ec451e9fefe2@web.de/

Markus,

This is not the first time you have suggested to someone to do something
that was simply incorrect.  Please actually test your suggestions before
proposing them.

> > Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>
> Should disjunctions eventually work in the semantic patch language also together with
> comparison operators?
> https://github.com/coccinelle/coccinelle/issues/40

No.

> Will any additional software adjustments be taken into account?

No.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error
  2019-09-06  5:15 ` Stephen Boyd
@ 2019-09-06  6:52   ` Markus Elfring
  2019-09-06  6:59     ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2019-09-06  6:52 UTC (permalink / raw)
  To: Stephen Boyd, YueHaibing, kernel-janitors, cocci
  Cc: Rob Herring, Michal Marek, Greg Kroah-Hartman,
	Bartlomiej Zolnierkiewicz, Nicolas Palix, linux-kernel,
	Javier Martinez Canillas, Andrzej Hajda, Andy Shevchenko,
	Mark Brown, Russell King, Marek Szyprowski

> > minus: parse error:
> >   File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
> >   around = '\(',
> >   whole content = if ( ret \( < \| <= \) 0 )
> >
> > In commit e56476897448 ("fpga: Remove dev_err() usage
> > after platform_get_irq()") log, I found the semantic patch,
> > it fix this issue.
> >
> > Fixes: 98051ba2b28b ("coccinelle: Add script to check for platform_get_irq() excessive prints")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
>
> Hmm I had this earlier but someone asked me to change it.

I proposed something also during the development for this SmPL script.
https://lkml.org/lkml/2019/7/24/274
https://lore.kernel.org/r/c98b8f50-1adf-ea95-a91c-ec451e9fefe2@web.de/


> Reviewed-by: Stephen Boyd <swboyd@chromium.org>

Should disjunctions eventually work in the semantic patch language also together with
comparison operators?
https://github.com/coccinelle/coccinelle/issues/40


Will any additional software adjustments be taken into account?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  3:30 [Cocci] [PATCH -next] coccinelle: platform_get_irq: Fix parse error YueHaibing
2019-09-06  5:09 ` Julia Lawall
2019-09-06  5:15 ` Stephen Boyd
2019-09-06  6:52   ` Markus Elfring
2019-09-06  6:59     ` Julia Lawall

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox