mtd/include/linux/mtd compatmac.h,1.65,1.66

ebiederman at lnxi.com ebiederman at lnxi.com
Wed Sep 1 21:45:48 EDT 2004


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv19985/include/linux/mtd

Modified Files:
	compatmac.h 
Log Message:
- Add a definition of list_for_each_safe for amd76xrom and ichxrom


Index: compatmac.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/compatmac.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- compatmac.h	11 Aug 2004 15:29:25 -0000	1.65
+++ compatmac.h	2 Sep 2004 01:45:46 -0000	1.66
@@ -188,4 +188,21 @@
 #define __user 
 #endif
 
+
+#ifndef list_for_each_entry_safe
+/**
+ * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * @pos:	the type * to use as a loop counter.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_safe(pos, n, head, member)			\
+	for (pos = list_entry((head)->next, typeof(*pos), member),	\
+		n = list_entry(pos->member.next, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+#endif
+
 #endif /* __LINUX_MTD_COMPATMAC_H__ */





More information about the linux-mtd-cvs mailing list