Changes by: flatcap
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv11249/include
Modified Files:
list.h
Log Message:
added list_for_each_safe
removed pos->next (a prefetch), was confusing compiler
Index: list.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/list.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -U2 -r1.4 -r1.5
--- list.h 14 Apr 2002 13:56:45 -0000 1.4
+++ list.h 30 Jun 2002 17:01:53 -0000 1.5
@@ -148,7 +148,16 @@
*/
#define list_for_each(pos, head) \
- for (pos = (head)->next, pos->next; pos != (head); \
- pos = pos->next, pos->next)
-
+ for (pos = (head)->next; pos != (head); pos = pos->next)
+
+/**
+ * list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos: the &struct list_head to use as a loop counter.
+ * @n: another &struct list_head to use as temporary storage
+ * @head: the head for your list.
+ */
+#define list_for_each_safe(pos, n, head) \
+ for (pos = (head)->next, n = pos->next; pos != (head); \
+ pos = n, n = pos->next)
+
#endif
|