[Devel] Re: [PATCH] Introduce a handy list_first_entry macro

Andi Kleen andi at firstfloor.org
Tue Apr 17 08:19:12 PDT 2007


Pavel Emelianov <xemul at sw.ru> writes:

> There are many places in the kernel where the construction like
> 
>    foo = list_entry(head->next, struct foo_struct, list);
> 
> are used. 
> The code might look more descriptive and neat if using the macro
> 
>    list_first_entry(head, type, member) \
>              list_entry((head)->next, type, member)

Thanks. I always wanted that too.

-andi




More information about the Devel mailing list