OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Introduce a handy list_first_entry macro
Re: [PATCH] Introduce a handy list_first_entry macro [message #12168 is a reply to message #12078] Wed, 18 April 2007 11:42 Go to previous message
Nikita Danilov is currently offline  Nikita Danilov
Messages: 1
Registered: April 2007
Junior Member
Pavel Emelianov 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)

Won't list_next_entry() be more descriptive name for that?

Nikita.
 
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: Sat Aug 30 10:25:06 GMT 2025

Total time taken to generate the page: 0.08343 seconds