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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Replace magic number for NULL (~0) with PAGE_LIST_NULL
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Sep 2009 02:00:30 -0700
Delivery-date: Tue, 15 Sep 2009 02:01:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Replace magic number for NULL (~0) with PAGE_LIST_NULL, Xen patchbot-unstable <=