diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-12-16 16:38:25 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2008-12-16 16:38:25 +1100 |
commit | 9057583b8b37d07eb9af2fd48674f1732fecda17 (patch) | |
tree | a4e41b5d750387418ddec5623965c32974537e43 /lib/list | |
parent | 5eb7f7bcd3431cd8f634b02b71bd78f6162c2af3 (diff) | |
download | talos-petitboot-9057583b8b37d07eb9af2fd48674f1732fecda17.tar.gz talos-petitboot-9057583b8b37d07eb9af2fd48674f1732fecda17.zip |
Add device handler cleanup
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/list')
-rw-r--r-- | lib/list/list.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/list/list.h b/lib/list/list.h index 3858cf6..f78411e 100644 --- a/lib/list/list.h +++ b/lib/list/list.h @@ -30,6 +30,13 @@ struct list { &pos->member != &(list)->head; \ pos = list_entry(pos->member.next, typeof(*pos), member)) +#define list_for_each_entry_safe(list, pos, n, member) \ + for (pos = list_entry((list)->head.next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != &(list)->head; \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + + void list_init(struct list *list); void list_add(struct list *list, struct list_item *item); |