Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [RFC/PATCH] Introduce list_get() and list_get_tail() | Date | Sat, 8 Jul 2006 20:31:17 +0200 |
| |
Am Saturday 08 July 2006 07:24 schrieb Dmitry Torokhov: > +/** > + * list_get - get first element in a list > + * @head: the head of your list > + */ > +static inline struct list_head *list_get(struct list_head *head) > +{ > + return head->next; > +}
I would expect it to be more useful when combined with list_entry(), something like
#define list_first_entry(list, type, member) \ container_of((list)->next, type, member) #define list_last_entry(list, type, member) \ container_of((list)->prev, type, member)
Arnd <>< - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |