Skip to contentSkip to conversation

page_list_* cleanup

PATCH In review George Dunlap 2 participants 3 messages Sep 11, 2009 – Sep 14, 2009

lore
Share & tools
lore
#2 lore raw

Oops... here you go.
-George

Quoted 17 lines · Keir Fraser

Patch not attached.

Quoted 9 lines · George Dunlap

Replace magic number for NULL (~0) with PAGE_LIST_NULL in the page_list_* functions.  No functional change.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

xen/include/xen/mm.h +9 -7
diff -r d077eda86803 xen/include/xen/mm.h
@@ -101,11 +101,13 @@
 /* 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 @@
     else
     {
         head->tail = page;
-        page->list.next = ~0;
+        page->list.next = PAGE_LIST_NULL;
     }
-    page->list.prev = ~0;
+    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 @@
     }
     else
     {
-        page->list.prev = ~0;
+        page->list.prev = PAGE_LIST_NULL;
         head->next = page;
     }
     head->tail = page;
@@ -169,7 +171,7 @@
     {
         if ( head->tail != page )
         {
-            next->list.prev = ~0;
+            next->list.prev = PAGE_LIST_NULL;
             head->next = next;
         }
         else
@@ -179,7 +181,7 @@
 
     if ( head->tail == page )
     {
-        prev->list.next = ~0;
+        prev->list.next = PAGE_LIST_NULL;
         head->tail = prev;
         return 1;
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel