OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Introduce a handy list_first_entry macro
Re: [PATCH] Introduce a handy list_first_entry macro [message #12088 is a reply to message #12078] Tue, 17 April 2007 14:21 Go to previous messageGo to previous message
Andi Kleen is currently offline  Andi Kleen
Messages: 33
Registered: February 2006
Member
Pavel Emelianov <xemul@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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)
Next Topic: [PATCH] Show slab memory usage on OOM and SysRq-M
Goto Forum:
  


Current Time: Sun Jul 13 14:36:14 GMT 2025

Total time taken to generate the page: 0.02050 seconds