[Tinyx-devel] [PATCH] List: change list_add_tail from define to inline function.
Status: Planning
Brought to you by:
davidcohen
From: David C. <da...@gm...> - 2007-12-11 23:09:17
|
Signed-off-by: David Cohen <da...@gm...> --- include/tinyx/list.h | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/tinyx/list.h b/include/tinyx/list.h index 0272f86..55020b1 100644 --- a/include/tinyx/list.h +++ b/include/tinyx/list.h @@ -22,7 +22,7 @@ struct list_head { * * @list: the list being initialized */ -static inline void init_list_head(struct list_head *list) +static void inline init_list_head(struct list_head *list) { list->next = list; list->prev = list; @@ -32,11 +32,13 @@ static inline void init_list_head(struct list_head *list) * list_add_tail - add a new entry at the end of the list * * @head: the head of the current list - * @new: the member to insert + * @queue: the member to insert */ -#define list_add_tail(head, new) \ - (head)->next = (new)->next; \ - (new)->next = (head); +static void inline list_add_tail(struct list_head *head, struct list_head *queue) +{ + head->next = queue->next; + queue->next = head; +} /* * list_del_tail - delete the tail from the list -- 1.5.3.5 |