WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] missing mini-os list_top macro

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] missing mini-os list_top macro
From: Diego Ongaro <diego.ongaro@xxxxxxxxxx>
Date: Fri, 18 Jul 2008 15:18:19 +0100
Delivery-date: Fri, 18 Jul 2008 07:18:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509)
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. 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] missing mini-os list_top macro, Diego Ongaro <=