X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Flist.h;h=f29fc9c1a964f299e525c65e2ffa847db35ec07c;hb=9b7530c83d04da28fdded741e718721d509c74b1;hp=f9d71eab05eecc9a7d3891d346b86aa58d24233b;hpb=f8abea8f8c24ecdad6d6861bffb912f23f2741cd;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/list.h b/include/linux/list.h index f9d71eab05e..f29fc9c1a96 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -264,8 +264,8 @@ static inline void list_del_init(struct list_head *entry) */ static inline void list_move(struct list_head *list, struct list_head *head) { - __list_del(list->prev, list->next); - list_add(list, head); + __list_del(list->prev, list->next); + list_add(list, head); } /** @@ -276,8 +276,8 @@ static inline void list_move(struct list_head *list, struct list_head *head) static inline void list_move_tail(struct list_head *list, struct list_head *head) { - __list_del(list->prev, list->next); - list_add_tail(list, head); + __list_del(list->prev, list->next); + list_add_tail(list, head); } /** @@ -425,6 +425,17 @@ static inline void list_splice_init_rcu(struct list_head *list, #define list_entry(ptr, type, member) \ container_of(ptr, type, member) +/** + * list_first_entry - get the first element from a list + * @ptr: the list head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + * + * Note, that list is expected to be not empty. + */ +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor.