Re: [RFC/PATCH] Introduce list_get() and list_get_tail()
From: Arnd Bergmann
Date: Sat Jul 08 2006 - 14:29:07 EST
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/