Skip to contentSkip to conversation

adjust assertion in alloc_heap_pages()

PATCH In review Jan Beulich 3 participants 3 messages Apr 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 adjust assertion in alloc_heap_pages()

Older gcc warns (and due to -Werror fails) on this ASSERT() now that "node" is of unsigned type. Make it more useful at once.

xen/common/page_alloc.c +1 -1
@@ -604,7 +604,7 @@ static struct page_info *alloc_heap_page
     }
     first_node = node;
 
-    ASSERT(node >= 0);
+    ASSERT(node < MAX_NUMNODES);
     ASSERT(zone_lo <= zone_hi);
     ASSERT(zone_hi < NR_ZONES);
 

adjust assertion in alloc_heap_pages()

Older gcc warns (and due to -Werror fails) on this ASSERT() now that "node" is of unsigned type. Make it more useful at once.

xen/common/page_alloc.c +1 -1
@@ -604,7 +604,7 @@ static struct page_info *alloc_heap_page
     }
     first_node = node;
 
-    ASSERT(node >= 0);
+    ASSERT(node < MAX_NUMNODES);
     ASSERT(zone_lo <= zone_hi);
     ASSERT(zone_hi < NR_ZONES);
 

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jan Beulich
Quoted 4 lines · Jan Beulich

Older gcc warns (and due to -Werror fails) on this ASSERT() now that "node" is of unsigned type. Make it more useful at once.

Coverity-ID: 1055630

Quoted 17 lines
xen/common/page_alloc.c +1 -1
@@ -604,7 +604,7 @@ static struct page_info *alloc_heap_page
     }
     first_node = node;
 
-    ASSERT(node >= 0);
+    ASSERT(node < MAX_NUMNODES);
     ASSERT(zone_lo <= zone_hi);
     ASSERT(zone_hi < NR_ZONES);
 
Quoted 4 lines

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

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