All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script
@ 2019-05-14 16:44 Markus Elfring
  2019-05-14 16:48 ` [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules Markus Elfring
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Markus Elfring @ 2019-05-14 16:44 UTC (permalink / raw)
  To: Gilles Muller, Julia Lawall, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Petr Strnad, Wen Yang
  Cc: Coccinelle, LKML, Yi Wang

This script for the semantic patch language contains implementation details
which can be improved.

Markus Elfring (3):
  Use formatted strings directly in SmPL rules
  Reduce a bit of duplicate SmPL code
  Extend when constraints for two SmPL ellipses

 .../coccinelle/free/pci_free_consistent.cocci | 28 ++++++++++---------
 1 file changed, 15 insertions(+), 13 deletions(-)

--
2.21.0


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

* [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules
  2019-05-14 16:44 [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script Markus Elfring
@ 2019-05-14 16:48 ` Markus Elfring
  2019-05-14 19:50   ` Julia Lawall
  2019-05-14 16:50 ` [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code Markus Elfring
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-14 16:48 UTC (permalink / raw)
  To: Gilles Muller, Julia Lawall, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang
  Cc: Coccinelle, LKML, Yi Wang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 14 May 2019 16:54:40 +0200

Formatted strings were always assigned to the Python variable “msg”
before they were used in two rules of a script for the semantic
patch language.
Delete these extra variables so that the specified string objects
are directly used for the desired data output.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 scripts/coccinelle/free/pci_free_consistent.cocci | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
index 43600ccb62a8..2056d6680cb8 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -38,15 +38,15 @@ return@p2 ...;
 p1 << search.p1;
 p2 << search.p2;
 @@
-
-msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
-coccilib.report.print_report(p2[0],msg)
+coccilib.report.print_report(p2[0],
+                             "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s"
+                             % (p1[0].line,p2[0].line))

 @script:python depends on org@
 p1 << search.p1;
 p2 << search.p2;
 @@
-
-msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
-cocci.print_main(msg,p1)
+cocci.print_main("ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s"
+                 % (p1[0].line,p2[0].line),
+                 p1)
 cocci.print_secs("",p2)
--
2.21.0


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

* [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-14 16:44 [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script Markus Elfring
  2019-05-14 16:48 ` [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules Markus Elfring
  2019-05-14 16:50 ` [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code Markus Elfring
@ 2019-05-14 16:50 ` Markus Elfring
  2019-05-14 19:47   ` Julia Lawall
  2019-05-14 16:52 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses Markus Elfring
  3 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-14 16:50 UTC (permalink / raw)
  To: Gilles Muller, Julia Lawall, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang
  Cc: Coccinelle, LKML, Yi Wang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 14 May 2019 17:18:24 +0200

A return statement was specified with a known value for three branches
of a SmPL disjunction.
Reduce duplicate SmPL code there by using another disjunction for
these return values.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 scripts/coccinelle/free/pci_free_consistent.cocci | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
index 2056d6680cb8..45bc14ece151 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -25,11 +25,11 @@ if (id == NULL || ...) { ... return ...; }
     when != e = (T)id
     when exists
 (
-return 0;
-|
-return 1;
-|
-return id;
+ return
+(0
+|1
+|id
+);
 |
 return@p2 ...;
 )
--
2.21.0


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

* [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-14 16:44 [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script Markus Elfring
  2019-05-14 16:48 ` [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules Markus Elfring
@ 2019-05-14 16:50 ` Markus Elfring
  2019-05-14 16:50 ` Markus Elfring
  2019-05-14 16:52 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses Markus Elfring
  3 siblings, 0 replies; 18+ messages in thread
From: Markus Elfring @ 2019-05-14 16:50 UTC (permalink / raw)
  To: Gilles Muller, Julia Lawall, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang
  Cc: Coccinelle, LKML, Yi Wang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 14 May 2019 17:18:24 +0200

A return statement was specified with a known value for three branches
of a SmPL disjunction.
Reduce duplicate SmPL code there by using another disjunction for
these return values.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 scripts/coccinelle/free/pci_free_consistent.cocci | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
index 2056d6680cb8..45bc14ece151 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -25,11 +25,11 @@ if (id == NULL || ...) { ... return ...; }
     when != e = (T)id
     when exists
 (
-return 0;
-|
-return 1;
-|
-return id;
+ return
+(0
+|1
+|id
+);
 |
 return@p2 ...;
 )
--
2.21.0


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

* [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
  2019-05-14 16:44 [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script Markus Elfring
                   ` (2 preceding siblings ...)
  2019-05-14 16:50 ` Markus Elfring
@ 2019-05-14 16:52 ` Markus Elfring
  2019-05-14 19:50   ` Julia Lawall
  3 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-14 16:52 UTC (permalink / raw)
  To: Gilles Muller, Julia Lawall, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang
  Cc: Coccinelle, LKML, Yi Wang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 14 May 2019 18:12:15 +0200

A SmPL ellipsis was specified for a search approach so that additional
source code would be tolerated between an assignment to a local variable
and the corresponding null pointer check.

But such code should be restricted.
* The local variable must not be reassigned there.
* It must also not be forwarded to an other assignment target.

Take additional casts for these code exclusion specifications into account
together with optional parentheses.

Fixes: f7b167113753e95ae61383e234f8d10142782ace ("scripts: Coccinelle script for pci_free_consistent()")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 scripts/coccinelle/free/pci_free_consistent.cocci | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
index 45bc14ece151..48a36adfa3ce 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -13,13 +13,15 @@ virtual org
 local idexpression id;
 expression x,y,z,e;
 position p1,p2;
-type T;
+type T,T2,T3,T4;
 @@

 id = pci_alloc_consistent@p1(x,y,&z)
-... when != e = id
+ ... when != id = (T2)(e)
+     when != e = (T3)(id)
 if (id == NULL || ...) { ... return ...; }
 ... when != pci_free_consistent(x,y,id,z)
+    when != id = (T4)(e)
     when != if (id) { ... pci_free_consistent(x,y,id,z) ... }
     when != if (y) { ... pci_free_consistent(x,y,id,z) ... }
     when != e = (T)id
--
2.21.0


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

* Re: [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-14 16:50 ` Markus Elfring
@ 2019-05-14 19:47   ` Julia Lawall
  2019-05-15  5:35     ` [2/3] " Markus Elfring
  0 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2019-05-14 19:47 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Gilles Muller, Julia Lawall, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang, Coccinelle, LKML, Yi Wang



On Tue, 14 May 2019, Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 14 May 2019 17:18:24 +0200
>
> A return statement was specified with a known value for three branches
> of a SmPL disjunction.
> Reduce duplicate SmPL code there by using another disjunction for
> these return values.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

NACK.  The goak is not to squeeze the most information into the fewest
number of characters.  The rule was fine as it was.

julia


> ---
>  scripts/coccinelle/free/pci_free_consistent.cocci | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
> index 2056d6680cb8..45bc14ece151 100644
> --- a/scripts/coccinelle/free/pci_free_consistent.cocci
> +++ b/scripts/coccinelle/free/pci_free_consistent.cocci
> @@ -25,11 +25,11 @@ if (id == NULL || ...) { ... return ...; }
>      when != e = (T)id
>      when exists
>  (
> -return 0;
> -|
> -return 1;
> -|
> -return id;
> + return
> +(0
> +|1
> +|id
> +);
>  |
>  return@p2 ...;
>  )
> --
> 2.21.0
>
>

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

* Re: [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules
  2019-05-14 16:48 ` [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules Markus Elfring
@ 2019-05-14 19:50   ` Julia Lawall
  2019-05-15  5:27     ` [1/3] " Markus Elfring
  0 siblings, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2019-05-14 19:50 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang

[-- Attachment #1: Type: text/plain, Size: 2012 bytes --]



On Tue, 14 May 2019, Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 14 May 2019 16:54:40 +0200
>
> Formatted strings were always assigned to the Python variable “msg”
> before they were used in two rules of a script for the semantic
> patch language.
> Delete these extra variables so that the specified string objects
> are directly used for the desired data output.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

NACK.  If the code is going to change, I would rather it come closer to
staying within 80 characters.

julia


> ---
>  scripts/coccinelle/free/pci_free_consistent.cocci | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
> index 43600ccb62a8..2056d6680cb8 100644
> --- a/scripts/coccinelle/free/pci_free_consistent.cocci
> +++ b/scripts/coccinelle/free/pci_free_consistent.cocci
> @@ -38,15 +38,15 @@ return@p2 ...;
>  p1 << search.p1;
>  p2 << search.p2;
>  @@
> -
> -msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
> -coccilib.report.print_report(p2[0],msg)
> +coccilib.report.print_report(p2[0],
> +                             "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s"
> +                             % (p1[0].line,p2[0].line))
>
>  @script:python depends on org@
>  p1 << search.p1;
>  p2 << search.p2;
>  @@
> -
> -msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line)
> -cocci.print_main(msg,p1)
> +cocci.print_main("ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s"
> +                 % (p1[0].line,p2[0].line),
> +                 p1)
>  cocci.print_secs("",p2)
> --
> 2.21.0
>
>

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

* Re: [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
  2019-05-14 16:52 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses Markus Elfring
@ 2019-05-14 19:50   ` Julia Lawall
  0 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2019-05-14 19:50 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang



On Tue, 14 May 2019, Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 14 May 2019 18:12:15 +0200
>
> A SmPL ellipsis was specified for a search approach so that additional
> source code would be tolerated between an assignment to a local variable
> and the corresponding null pointer check.
>
> But such code should be restricted.
> * The local variable must not be reassigned there.
> * It must also not be forwarded to an other assignment target.
>
> Take additional casts for these code exclusion specifications into account
> together with optional parentheses.

I leave this up to the ZTE people.

julia


>
> Fixes: f7b167113753e95ae61383e234f8d10142782ace ("scripts: Coccinelle script for pci_free_consistent()")
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  scripts/coccinelle/free/pci_free_consistent.cocci | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
> index 45bc14ece151..48a36adfa3ce 100644
> --- a/scripts/coccinelle/free/pci_free_consistent.cocci
> +++ b/scripts/coccinelle/free/pci_free_consistent.cocci
> @@ -13,13 +13,15 @@ virtual org
>  local idexpression id;
>  expression x,y,z,e;
>  position p1,p2;
> -type T;
> +type T,T2,T3,T4;
>  @@
>
>  id = pci_alloc_consistent@p1(x,y,&z)
> -... when != e = id
> + ... when != id = (T2)(e)
> +     when != e = (T3)(id)
>  if (id == NULL || ...) { ... return ...; }
>  ... when != pci_free_consistent(x,y,id,z)
> +    when != id = (T4)(e)
>      when != if (id) { ... pci_free_consistent(x,y,id,z) ... }
>      when != if (y) { ... pci_free_consistent(x,y,id,z) ... }
>      when != e = (T)id
> --
> 2.21.0
>
>

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

* Re: [1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules
  2019-05-14 19:50   ` Julia Lawall
@ 2019-05-15  5:27     ` Markus Elfring
  2019-05-15  6:10       ` Julia Lawall
  0 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-15  5:27 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang

> NACK.  If the code is going to change, I would rather it come closer to
> staying within 80 characters.

Do you really prefer then to deviate from the Linux coding style
at such source code places?

Would you like to split affected string literals over multiple lines?

Regards,
Markus

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

* Re: [2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-14 19:47   ` Julia Lawall
@ 2019-05-15  5:35     ` Markus Elfring
  2019-05-15  6:11       ` Julia Lawall
  2019-05-15  6:11       ` Julia Lawall
  0 siblings, 2 replies; 18+ messages in thread
From: Markus Elfring @ 2019-05-15  5:35 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang

>> A return statement was specified with a known value for three branches
>> of a SmPL disjunction.
>> Reduce duplicate SmPL code there by using another disjunction for
>> these return values.
> NACK.  The goak is not to squeeze the most information into the fewest
> number of characters.

Can you accept any other formatting for the adjusted SmPL code?


> The rule was fine as it was.

Can different run time characteristics become relevant here?

Regards,
Markus

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

* Re: [1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules
  2019-05-15  5:27     ` [1/3] " Markus Elfring
@ 2019-05-15  6:10       ` Julia Lawall
  0 siblings, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2019-05-15  6:10 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Julia Lawall, Gilles Muller, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang, Coccinelle, LKML, Yi Wang



On Wed, 15 May 2019, Markus Elfring wrote:

> > NACK.  If the code is going to change, I would rather it come closer to
> > staying within 80 characters.
>
> Do you really prefer then to deviate from the Linux coding style
> at such source code places?
>
> Would you like to split affected string literals over multiple lines?

No, I want msg = ... so that the string starts earlier and ends earlier.

julia

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

* Re: [2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-15  5:35     ` [2/3] " Markus Elfring
@ 2019-05-15  6:11       ` Julia Lawall
  2019-05-15  6:11       ` Julia Lawall
  1 sibling, 0 replies; 18+ messages in thread
From: Julia Lawall @ 2019-05-15  6:11 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]



On Wed, 15 May 2019, Markus Elfring wrote:

> >> A return statement was specified with a known value for three branches
> >> of a SmPL disjunction.
> >> Reduce duplicate SmPL code there by using another disjunction for
> >> these return values.
> …
> > NACK.  The goak is not to squeeze the most information into the fewest
> > number of characters.
>
> Can you accept any other formatting for the adjusted SmPL code?

No.  It's fine as is.

>
>
> > The rule was fine as it was.
>
> Can different run time characteristics become relevant here?

No.

julia

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

* Re: [2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-15  5:35     ` [2/3] " Markus Elfring
  2019-05-15  6:11       ` Julia Lawall
@ 2019-05-15  6:11       ` Julia Lawall
  2019-05-15  7:02         ` Markus Elfring
  1 sibling, 1 reply; 18+ messages in thread
From: Julia Lawall @ 2019-05-15  6:11 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang

> Can different run time characteristics become relevant here?

Internally, they should be identical.

julia

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

* Re: [2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
  2019-05-15  6:11       ` Julia Lawall
@ 2019-05-15  7:02         ` Markus Elfring
       [not found]           ` <alpine.DEB.2.21.1905150908550.2591@hadrien>
  0 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-15  7:02 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, Coccinelle, LKML, Yi Wang

>> Can different run time characteristics become relevant here?
>
> Internally, they should be identical.

I got other imaginations in this area.

I assume that the evaluation of a separate SmPL disjunction
for the shown return values is occasionally nicer than
the repeated matching for the corresponding complete statement.
It might be that the possible run time difference will not be
big enough for you.

Regards,
Markus

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

* Re: Coccinelle: Handling of SmPL disjunctions
       [not found]           ` <alpine.DEB.2.21.1905150908550.2591@hadrien>
@ 2019-05-15  7:33             ` Markus Elfring
       [not found]               ` <alpine.DEB.2.20.1905151120370.3231@hadrien>
  0 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-15  7:33 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Coccinelle, LKML, Gilles Muller, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Wen Yang, Yi Wang

>>>> Can different run time characteristics become relevant here?
>>>
>>> Internally, they should be identical.
>>
>> I got other imaginations in this area.
>
> You imagination doesn't matter in this case.

They might result in collateral software evolution.


> What matters is what the code does.

At the moment then …


> It expands out disjunctions on expressions to the statement level.> So the internal representation is the same.

Thanks for such additional information. Is it represented in the software
documentation (besides the source code format)?

How do you think about to increase the matching granularity
for this functionality?

Regards,
Markus

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

* Re: Coccinelle: Handling of SmPL disjunctions
       [not found]               ` <alpine.DEB.2.20.1905151120370.3231@hadrien>
@ 2019-05-15  9:55                 ` Markus Elfring
  2019-07-09  9:52                     ` [Cocci] " Markus Elfring
  0 siblings, 1 reply; 18+ messages in thread
From: Markus Elfring @ 2019-05-15  9:55 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Coccinelle, LKML, Cheng Shengyu, Gilles Muller, Ma Jiang,
	Masahiro Yamada, Michal Marek, Nicolas Palix, Wen Yang, Yi Wang

>> Thanks for such additional information. Is it represented in the software
>> documentation (besides the source code format)?
>
> It is not a concern of the user.

I got interested in corresponding aspects.


> The documentation is not going to contain a description of every line
> in the implementation.

Some extensions can become nice and more helpful there.


>> How do you think about to increase the matching granularity
>> for this functionality?
>
> No idea what this means.  Disjunctions are expanded up to the level of the
> nodes in the control-flow graph.

We have got different expectations for working with such nodes
for possible (data flow) analysis.

Does the term “disjunction lifting” (from the SmPL manual) fit to this feedback?

Regards,
Markus

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

* Re: Coccinelle: Handling of SmPL disjunctions
  2019-05-15  9:55                 ` Markus Elfring
@ 2019-07-09  9:52                     ` Markus Elfring
  0 siblings, 0 replies; 18+ messages in thread
From: Markus Elfring @ 2019-07-09  9:52 UTC (permalink / raw)
  To: Julia Lawall, Coccinelle
  Cc: LKML, Cheng Shengyu, Gilles Muller, Ma Jiang, Masahiro Yamada,
	Michal Marek, Nicolas Palix, Wen Yang, Yi Wang

>>> How do you think about to increase the matching granularity
>>> for this functionality?
>>
>> No idea what this means.  Disjunctions are expanded up to the level of the
>> nodes in the control-flow graph.
>
> We have got different expectations for working with such nodes
> for possible (data flow) analysis.

Will the chances become better to clarify this functionality?

Which software components are involved so far?

Regards,
Markus

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

* Re: [Cocci] Coccinelle: Handling of SmPL disjunctions
@ 2019-07-09  9:52                     ` Markus Elfring
  0 siblings, 0 replies; 18+ messages in thread
From: Markus Elfring @ 2019-07-09  9:52 UTC (permalink / raw)
  To: Julia Lawall, Coccinelle
  Cc: Yi Wang, Michal Marek, Nicolas Palix, LKML, Ma Jiang,
	Cheng Shengyu, Wen Yang

>>> How do you think about to increase the matching granularity
>>> for this functionality?
>>
>> No idea what this means.  Disjunctions are expanded up to the level of the
>> nodes in the control-flow graph.
>
> We have got different expectations for working with such nodes
> for possible (data flow) analysis.

Will the chances become better to clarify this functionality?

Which software components are involved so far?

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

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

end of thread, other threads:[~2019-07-09  9:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 16:44 [PATCH 0/3] Coccinelle: pci_free_consistent: Adjustments for a SmPL script Markus Elfring
2019-05-14 16:48 ` [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules Markus Elfring
2019-05-14 19:50   ` Julia Lawall
2019-05-15  5:27     ` [1/3] " Markus Elfring
2019-05-15  6:10       ` Julia Lawall
2019-05-14 16:50 ` [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code Markus Elfring
2019-05-14 16:50 ` Markus Elfring
2019-05-14 19:47   ` Julia Lawall
2019-05-15  5:35     ` [2/3] " Markus Elfring
2019-05-15  6:11       ` Julia Lawall
2019-05-15  6:11       ` Julia Lawall
2019-05-15  7:02         ` Markus Elfring
     [not found]           ` <alpine.DEB.2.21.1905150908550.2591@hadrien>
2019-05-15  7:33             ` Coccinelle: Handling of SmPL disjunctions Markus Elfring
     [not found]               ` <alpine.DEB.2.20.1905151120370.3231@hadrien>
2019-05-15  9:55                 ` Markus Elfring
2019-07-09  9:52                   ` Markus Elfring
2019-07-09  9:52                     ` [Cocci] " Markus Elfring
2019-05-14 16:52 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses Markus Elfring
2019-05-14 19:50   ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.