Message ID | 1574184500-29870-3-git-send-email-Julia.Lawall@lip6.fr |
---|---|
State | New |
Headers | show |
Series | None | expand |
> From: Masahiro Yamada <yamada.masahiro@socionext.com> 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, ...); > + > +if ( \( ret < 0 \| ret <= 0 \) ) > +-{ > +-dev_err(...); > +S > +-} How do you think about to use the following SmPL code variant? + ret = +(platform_get_irq +|platform_get_irq_byname +)(E, ...); + + if ( \( ret < 0 \| ret <= 0 \) ) +-{ +-dev_err(...); + S +-} Regards, Markus
> From: Masahiro Yamada <yamada.masahiro@socionext.com> 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, ...); > + > +if ( \( ret < 0 \| ret <= 0 \) ) > +-{ > +-dev_err(...); > +S > +-} How do you think about to use the following SmPL code variant? + ret = +(platform_get_irq +|platform_get_irq_byname +)(E, ...); + + if ( \( ret < 0 \| ret <= 0 \) ) +-{ +-dev_err(...); + S +-} Regards, Markus
On Tue, 19 Nov 2019, Markus Elfring wrote: > > From: Masahiro Yamada <yamada.masahiro@socionext.com> > > 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_get_irq.cocci > > @@ -31,6 +31,25 @@ if ( \( ret < 0 \| ret <= 0 \) ) > … > > +ret = > > +( > > +platform_get_irq > > +| > > +platform_get_irq_byname > > +)(E, ...); > > + > > +if ( \( ret < 0 \| ret <= 0 \) ) > > +-{ > > +-dev_err(...); > > +S > > +-} > > How do you think about to use the following SmPL code variant? And the benefit is what? julia > + ret = > +(platform_get_irq > +|platform_get_irq_byname > +)(E, ...); > + > + if ( \( ret < 0 \| ret <= 0 \) ) > +-{ > +-dev_err(...); > + S > +-} > > Regards, > Markus >
> Sorry, I seem to have done something quite wrong on this patch. Interesting … > I will fix it. Thanks. Development will be continued: https://lkml.org/lkml/2019/11/19/1681 https://lore.kernel.org/patchwork/patch/1156089/ https://lore.kernel.org/cocci/1574197705-31132-3-git-send-email-Julia.Lawall@lip6.fr/ >> How do you think about to use the following SmPL code variant? > > And the benefit is what? … >> + ret = >> +(platform_get_irq >> +|platform_get_irq_byname >> +)(E, ...); >> + >> + if ( \( ret < 0 \| ret <= 0 \) ) >> +-{ >> +-dev_err(...); >> + S >> +-} * I suggest to use a different coding style for the specification of two function names in the SmPL disjunction. * Would you like to avoid the mixing of code items in the first text column? Regards, Markus
diff --git a/scripts/coccinelle/api/platform_get_irq.cocci b/scripts/coccinelle/api/platform_get_irq.cocci index c6ac755..7ac32ee 100644 --- a/scripts/coccinelle/api/platform_get_irq.cocci +++ b/scripts/coccinelle/api/platform_get_irq.cocci @@ -31,6 +31,25 @@ if ( \( ret < 0 \| ret <= 0 \) ) @depends on patch@ expression ret; struct platform_device *E; +statement S; +@@ + +ret = +( +platform_get_irq +| +platform_get_irq_byname +)(E, ...); + +if ( \( ret < 0 \| ret <= 0 \) ) +-{ +-dev_err(...); +S +-} + +@depends on patch@ +expression ret; +struct platform_device *E; @@ ret =