All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] missing mini-os list_top macro
@ 2008-07-18 14:18 Diego Ongaro
  0 siblings, 0 replies; only message in thread
From: Diego Ongaro @ 2008-07-18 14:18 UTC (permalink / raw)
  To: xen-devel

mini-os is missing list_top in its list.h
---
diff -r 37289395de03 extras/mini-os/include/list.h
--- a/extras/mini-os/include/list.h	Fri Jul 18 14:20:13 2008 +0100
+++ b/extras/mini-os/include/list.h	Fri Jul 18 15:05:42 2008 +0100
@@ -23,6 +23,12 @@
 #define INIT_LIST_HEAD(ptr) do { \
 	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
 } while (0)
+
+#define list_top(head, type, member)					  \
+({ 									  \
+	struct list_head *_head = (head);				  \
+	list_empty(_head) ? NULL : list_entry(_head->next, type, member); \
+})
 
 /*
  * Insert a new entry between two known consecutive entries. 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-18 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 14:18 [PATCH] missing mini-os list_top macro Diego Ongaro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.