mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] coccinelle: api/kstrdup: fix coccinelle position
@ 2020-06-19 13:23 Denis Efremov
  2020-06-19 19:32 ` [Cocci] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Efremov @ 2020-06-19 13:23 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Denis Efremov, cocci, linux-kernel

There is a typo in rule r2. Position p1 should be attached to kzalloc()
call.

Fixes: 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some semantic patches")
Signed-off-by: Denis Efremov <efremov@linux.com>
---
 scripts/coccinelle/api/kstrdup.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccinelle/api/kstrdup.cocci b/scripts/coccinelle/api/kstrdup.cocci
index 19f2645e6076..3c6dc5469ee4 100644
--- a/scripts/coccinelle/api/kstrdup.cocci
+++ b/scripts/coccinelle/api/kstrdup.cocci
@@ -66,7 +66,7 @@ position p1,p2;
 
 *   x = strlen(from) + 1;
     ... when != \( x = E1 \| from = E1 \)
-*   to = \(kmalloc@p1\|kzalloc@p2\)(x,flag);
+*   to = \(kmalloc@p1\|kzalloc@p1\)(x,flag);
     ... when != \(x = E2 \| from = E2 \| to = E2 \)
     if (to==NULL || ...) S
     ... when != \(x = E3 \| from = E3 \| to = E3 \)
-- 
2.26.2


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

* Re: [Cocci] [PATCH] coccinelle: api/kstrdup: fix coccinelle position
  2020-06-19 13:23 [PATCH] coccinelle: api/kstrdup: fix coccinelle position Denis Efremov
@ 2020-06-19 19:32 ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2020-06-19 19:32 UTC (permalink / raw)
  To: Denis Efremov; +Cc: cocci, linux-kernel



On Fri, 19 Jun 2020, Denis Efremov wrote:

> There is a typo in rule r2. Position p1 should be attached to kzalloc()
> call.

Clearly.  Thanks.  Applied.

julia


>
> Fixes: 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some semantic patches")
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  scripts/coccinelle/api/kstrdup.cocci | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccinelle/api/kstrdup.cocci b/scripts/coccinelle/api/kstrdup.cocci
> index 19f2645e6076..3c6dc5469ee4 100644
> --- a/scripts/coccinelle/api/kstrdup.cocci
> +++ b/scripts/coccinelle/api/kstrdup.cocci
> @@ -66,7 +66,7 @@ position p1,p2;
>
>  *   x = strlen(from) + 1;
>      ... when != \( x = E1 \| from = E1 \)
> -*   to = \(kmalloc@p1\|kzalloc@p2\)(x,flag);
> +*   to = \(kmalloc@p1\|kzalloc@p1\)(x,flag);
>      ... when != \(x = E2 \| from = E2 \| to = E2 \)
>      if (to==NULL || ...) S
>      ... when != \(x = E3 \| from = E3 \| to = E3 \)
> --
> 2.26.2
>
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

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

* Re: [PATCH] coccinelle: api/kstrdup: fix coccinelle position
@ 2020-06-19 15:26 Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2020-06-19 15:26 UTC (permalink / raw)
  To: Denis Efremov, Coccinelle, Gilles Muller, Julia Lawall,
	Masahiro Yamada, Michal Marek, Nicolas Palix
  Cc: linux-kernel, kernel-janitors

> There is a typo in rule r2. Position p1 should be attached to kzalloc() call.

I find such a suggestion reasonable for an implementation detail.

I would find an other patch subject clearer.


How do you think about to move the specification “@p1” out of SmPL disjunctions?

Regards,
Markus

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

end of thread, other threads:[~2020-06-19 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 13:23 [PATCH] coccinelle: api/kstrdup: fix coccinelle position Denis Efremov
2020-06-19 19:32 ` [Cocci] " Julia Lawall
2020-06-19 15:26 Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome