summaryrefslogtreecommitdiffstats
path: root/lib/list
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2009-02-27 14:53:52 +0000
committerJeremy Kerr <jk@ozlabs.org>2009-03-23 21:47:15 +1100
commita582671979c7b20436f9e993eda90452f7223f3c (patch)
tree9d32e585f54f5ea097de65569fd0dac964618f30 /lib/list
parent03f8fa62281b250f2b832a58d49d1b85fadc3338 (diff)
downloadtalos-petitboot-a582671979c7b20436f9e993eda90452f7223f3c.tar.gz
talos-petitboot-a582671979c7b20436f9e993eda90452f7223f3c.zip
Add list_for_each_entry_continue routine
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>
Diffstat (limited to 'lib/list')
-rw-r--r--lib/list/list.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/list/list.h b/lib/list/list.h
index fe2c1d3..27b57fc 100644
--- a/lib/list/list.h
+++ b/lib/list/list.h
@@ -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);
OpenPOWER on IntegriCloud