The list_for_each example is currently incomplete and just removes the whole for
block which can make use for list_for_each. This patch changes the example to
replace the for header with list_for_each.

Signed-off-by: Lars-Peter Clausen <[email protected]>
---
 demos/janitorings/list_for_each.cocci |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/demos/janitorings/list_for_each.cocci 
b/demos/janitorings/list_for_each.cocci
index a850fa3..52e859a 100644
--- a/demos/janitorings/list_for_each.cocci
+++ b/demos/janitorings/list_for_each.cocci
@@ -1,25 +1,21 @@
 @@
-iterator list_for_each;
+iterator name list_for_each;
 statement S;
 expression head;
 struct list_head *pos;
 @@
-- for (pos = head.next; pos != &head; pos = pos->next) 
--  S
-//+ list_for_each(pos, &head) 
-
+- for (pos = head.next; pos != &head; pos = pos->next)
++ list_for_each (pos, &head)
+   S
 
 @@
-//iterator list_for_each;
 statement S;
 expression head;
 struct list_head *pos;
 @@
-- for (pos = head->next; pos != head; pos = pos->next) 
--  S
-//+ list_for_each(pos, head) 
-
-
+- for (pos = head->next; pos != head; pos = pos->next)
++ list_for_each (pos, head)
+   S
 
 // list_add, list_del
 // list_move
-- 
1.7.2.5

_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to