Pavel Emelianov b5e618181a Introduce a handy list_first_entry macro
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)

Here is the macro itself and the examples of its usage in the generic code.
 If it will turn out to be useful, I can prepare the set of patches to
inject in into arch-specific code, drivers, networking, etc.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Zach Brown <zach.brown@oracle.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: John McCutchan <ttb@tentacle.dhs.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:11 -07:00
..
2007-05-08 11:14:59 -07:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:15:01 -07:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:14:57 -07:00
2006-10-04 06:51:26 -06:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:15:09 -07:00
2007-05-08 11:15:09 -07:00
2006-12-07 08:39:25 -08:00
2007-05-08 11:15:08 -07:00
2007-05-08 11:15:01 -07:00
2007-05-08 11:15:09 -07:00
2007-05-07 12:12:58 -07:00
2006-12-07 08:39:25 -08:00
2007-05-08 11:14:57 -07:00
2006-10-01 00:39:19 -07:00
2006-03-23 07:38:11 -08:00
2007-03-29 14:26:42 +02:00
2007-05-08 11:15:01 -07:00
2007-05-08 11:15:04 -07:00