Add list_for_each_entry_continue routine
authorGeoff Levand <geoffrey.levand@am.sony.com>
Fri, 27 Feb 2009 14:53:52 +0000 (14:53 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 23 Mar 2009 10:47:15 +0000 (21:47 +1100)
Add a new list iteration routine list_for_each_entry_continue().  Continues
iteration from a user specified list item.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
lib/list/list.h

index fe2c1d39358e8614cbc7cd8deed23df6e7d50a8d..27b57fc752bc3ecd99f6206e3af64a4098ff2685 100644 (file)
@@ -30,6 +30,10 @@ struct list {
             &pos->member != &(list)->head;     \
             pos = list_entry(pos->member.next, typeof(*pos), member))
 
+#define list_for_each_entry_continue(_list, _pos, _member) \
+       for (; &_pos->_member != &(_list)->head; \
+               _pos = list_entry(_pos->_member.next, typeof(*_pos), _member))
+
 void list_init(struct list *list);
 void list_insert_before(struct list_item *next, struct list_item *new);
 void list_insert_after(struct list_item *prev, struct list_item *new);