mm/page_alloc.c: refine the calculation of highest possible node id
[linux-2.6-microblaze.git] / mm / page_alloc.c
index 5b5240b..809e27e 100644 (file)
@@ -5478,11 +5478,9 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size,
  */
 void __init setup_nr_node_ids(void)
 {
-       unsigned int node;
-       unsigned int highest = 0;
+       unsigned int highest;
 
-       for_each_node_mask(node, node_possible_map)
-               highest = node;
+       highest = find_last_bit(node_possible_map.bits, MAX_NUMNODES);
        nr_node_ids = highest + 1;
 }
 #endif