* [PATCH] coccinelle: use exists to improve efficiency
@ 2017-11-12 15:02 Julia Lawall
2017-11-15 14:31 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2017-11-12 15:02 UTC (permalink / raw)
To: Masahiro Yamada
Cc: cocci, Nicolas Palix, Gilles Muller, linux-kernel, Michal Marek
This just needs to find any reassignment of the loop iterator, and doesn't
need such a thing on all execution paths, so use exists on the first rule.
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---
diff --git a/scripts/coccinelle/iterators/list_entry_update.cocci b/scripts/coccinelle/iterators/list_entry_update.cocci
index 873f444..be6f9f1 100644
--- a/scripts/coccinelle/iterators/list_entry_update.cocci
+++ b/scripts/coccinelle/iterators/list_entry_update.cocci
@@ -15,7 +15,7 @@ virtual context
virtual org
virtual report
-@r@
+@r exists@
iterator name list_for_each_entry;
expression x,E;
position p1,p2;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] coccinelle: use exists to improve efficiency
2017-11-12 15:02 [PATCH] coccinelle: use exists to improve efficiency Julia Lawall
@ 2017-11-15 14:31 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2017-11-15 14:31 UTC (permalink / raw)
To: Julia Lawall
Cc: cocci, Nicolas Palix, Gilles Muller, Linux Kernel Mailing List,
Michal Marek
2017-11-13 0:02 GMT+09:00 Julia Lawall <julia.lawall@lip6.fr>:
> This just needs to find any reassignment of the loop iterator, and doesn't
> need such a thing on all execution paths, so use exists on the first rule.
>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>
> ---
>
> diff --git a/scripts/coccinelle/iterators/list_entry_update.cocci b/scripts/coccinelle/iterators/list_entry_update.cocci
> index 873f444..be6f9f1 100644
> --- a/scripts/coccinelle/iterators/list_entry_update.cocci
> +++ b/scripts/coccinelle/iterators/list_entry_update.cocci
> @@ -15,7 +15,7 @@ virtual context
> virtual org
> virtual report
>
> -@r@
> +@r exists@
> iterator name list_for_each_entry;
> expression x,E;
> position p1,p2;
Applied to linux-kbuild/misc. Thanks!
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-15 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-12 15:02 [PATCH] coccinelle: use exists to improve efficiency Julia Lawall
2017-11-15 14:31 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).