diff options
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index e77559a68..656aacc2a 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -17,8 +17,10 @@ struct list_head { struct list_head *next, *prev; }; +#define LIST_HEAD_INIT(name) { &(name), &(name) } + #define LIST_HEAD(name) \ - struct list_head name = { &name, &name } + struct list_head name = LIST_HEAD_INIT(name) #define INIT_LIST_HEAD(ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ @@ -49,6 +51,14 @@ static __inline__ void list_add(struct list_head *new, struct list_head *head) } /* + * Insert a new entry before the specified head.. + */ +static __inline__ void list_add_tail(struct list_head *new, struct list_head *head) +{ + __list_add(new, head->prev, head); +} + +/* * Delete a list entry by making the prev/next entries * point to each other. * |