mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [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	[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

all inboxes | Powered by JetHome®