coccinelle: use exists to improve efficiency
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 12 Nov 2017 15:02:18 +0000 (16:02 +0100)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 14 Nov 2017 14:21:16 +0000 (23:21 +0900)
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>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/coccinelle/iterators/list_entry_update.cocci

index 873f444e7137f0fbbde99b683a382fbd93c3d472..be6f9f1abb343c07c42a696f60029d209a82df0d 100644 (file)
@@ -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;