]> git.ozlabs.org Git - petitboot/commitdiff
Add new macro DEFINE_LIST()
authorGeoff Levand <geoff@infradead.org>
Tue, 27 Mar 2012 03:21:21 +0000 (20:21 -0700)
committerGeoff Levand <geoff@infradead.org>
Tue, 27 Mar 2012 03:21:21 +0000 (20:21 -0700)
Signed-off-by: Geoff Levand <geoff@infradead.org>
lib/list/list.h

index 7f9955f93115e2761fbe1b0ec94398480d40e8a8..cd9cd105911e2316e8bbbfec87037287253e4242 100644 (file)
@@ -41,13 +41,15 @@ struct list {
        for (; _pos; _pos = list_next_entry(_list, _pos, _member))
 
 
        for (; _pos; _pos = list_next_entry(_list, _pos, _member))
 
 
-#define STATIC_LIST(_list) static struct list _list = { \
+#define DEFINE_LIST(_list) struct list _list = { \
        .head = { \
                .next = &_list.head, \
                .prev = &_list.head \
        } \
 }
 
        .head = { \
                .next = &_list.head, \
                .prev = &_list.head \
        } \
 }
 
+#define STATIC_LIST(_list) static DEFINE_LIST(_list)
+
 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);
 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);