summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2011-11-11 22:28:50 -0800
committerGeoff Levand <geoff@infradead.org>2011-11-11 22:28:50 -0800
commit90428c4cc95d11c74871a92e3e7a340195d0997b (patch)
tree1aecc2ab3d8d0055413bb039b9d944310f87b8ef
parent2a62469043ec4570cff037227597902e943db02c (diff)
downloadtalos-petitboot-90428c4cc95d11c74871a92e3e7a340195d0997b.tar.gz
talos-petitboot-90428c4cc95d11c74871a92e3e7a340195d0997b.zip
Add STATIC_LIST initializer
Signed-off-by: Geoff Levand <geoff@infradead.org>
-rw-r--r--lib/list/list.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/list/list.h b/lib/list/list.h
index 53080a0..c8c5631 100644
--- a/lib/list/list.h
+++ b/lib/list/list.h
@@ -34,6 +34,13 @@ struct list {
for (; &_pos->_member != &(_list)->head; \
_pos = list_entry(_pos->_member.next, typeof(*_pos), _member))
+#define STATIC_LIST(_list) static struct list _list = { \
+ .head = { \
+ .next = &_list.head, \
+ .prev = &_list.head \
+ } \
+}
+
void list_init(struct list *list);
void list_insert_before(struct list_item *next, struct list_item *item);
void list_insert_after(struct list_item *prev, struct list_item *item);
OpenPOWER on IntegriCloud