[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Replace magic number for NULL (~0) with PAGE_LIST_NULL



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1253002763 -3600
# Node ID 848193b1ec26ccee37ffc7f953dce0ded04f90e0
# Parent  1cfd248d0fc8ff58d9c9c4b632f064a02e5ee28f
Replace magic number for NULL (~0) with PAGE_LIST_NULL
...in the page_list_* functions.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 xen/include/xen/mm.h |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -r 1cfd248d0fc8 -r 848193b1ec26 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h      Tue Sep 15 09:16:52 2009 +0100
+++ b/xen/include/xen/mm.h      Tue Sep 15 09:19:23 2009 +0100
@@ -101,11 +101,13 @@ struct page_list_head
 /* These must only have instances in struct page_info. */
 # define page_list_entry
 
+#define PAGE_LIST_NULL (~0)
+
 # define PAGE_LIST_HEAD_INIT(name) { NULL, NULL }
 # define PAGE_LIST_HEAD(name) \
     struct page_list_head name = PAGE_LIST_HEAD_INIT(name)
 # define INIT_PAGE_LIST_HEAD(head) ((head)->tail = (head)->next = NULL)
-# define INIT_PAGE_LIST_ENTRY(ent) ((ent)->prev = (ent)->next = ~0)
+# define INIT_PAGE_LIST_ENTRY(ent) ((ent)->prev = (ent)->next = PAGE_LIST_NULL)
 
 static inline int
 page_list_empty(const struct page_list_head *head)
@@ -140,15 +142,15 @@ page_list_add(struct page_info *page, st
     else
     {
         head->tail = page;
-        page->list.next = ~0;
-    }
-    page->list.prev = ~0;
+        page->list.next = PAGE_LIST_NULL;
+    }
+    page->list.prev = PAGE_LIST_NULL;
     head->next = page;
 }
 static inline void
 page_list_add_tail(struct page_info *page, struct page_list_head *head)
 {
-    page->list.next = ~0;
+    page->list.next = PAGE_LIST_NULL;
     if ( head->next )
     {
         page->list.prev = page_to_mfn(head->tail);
@@ -156,7 +158,7 @@ page_list_add_tail(struct page_info *pag
     }
     else
     {
-        page->list.prev = ~0;
+        page->list.prev = PAGE_LIST_NULL;
         head->next = page;
     }
     head->tail = page;
@@ -169,7 +171,7 @@ __page_list_del_head(struct page_info *p
     {
         if ( head->tail != page )
         {
-            next->list.prev = ~0;
+            next->list.prev = PAGE_LIST_NULL;
             head->next = next;
         }
         else
@@ -179,7 +181,7 @@ __page_list_del_head(struct page_info *p
 
     if ( head->tail == page )
     {
-        prev->list.next = ~0;
+        prev->list.next = PAGE_LIST_NULL;
         head->tail = prev;
         return 1;
     }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.