page-alloc: Rename the first_node local variable
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jun 2019 13:07:23 +0000 (14:07 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 27 Jun 2019 17:50:41 +0000 (18:50 +0100)
first_node is the name of a local variable, and part of the nodemask API.  The
only reason this compiles is because the nodemask API is implemented as a
macro rather than an inline function.

It is confusing to read, and breaks when the nodemask API is cleaned up.
Rename the local variable to just 'first' which is still clear in context.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/page_alloc.c

index 7825fd8c42ad4bdcb23e32b3a31e2790037d3cbe..7bbb44f7d1bc04a3931c4d3e237b2d6d8da96d8a 100644 (file)
@@ -810,7 +810,7 @@ static struct page_info *get_free_buddy(unsigned int zone_lo,
                                         unsigned int order, unsigned int memflags,
                                         const struct domain *d)
 {
-    nodeid_t first_node, node = MEMF_get_node(memflags), req_node = node;
+    nodeid_t first, node = MEMF_get_node(memflags), req_node = node;
     nodemask_t nodemask = d ? d->node_affinity : node_online_map;
     unsigned int j, zone, nodemask_retry = 0;
     struct page_info *pg;
@@ -832,7 +832,7 @@ static struct page_info *get_free_buddy(unsigned int zone_lo,
         ASSERT_UNREACHABLE();
         return NULL;
     }
-    first_node = node;
+    first = node;
 
     /*
      * Start with requested node, but exhaust all node memory in requested
@@ -878,19 +878,19 @@ static struct page_info *get_free_buddy(unsigned int zone_lo,
         {
             /* Very first node may be caller-specified and outside nodemask. */
             ASSERT(!nodemask_retry);
-            first_node = node = first_node(nodemask);
+            first = node = first_node(nodemask);
             if ( node < MAX_NUMNODES )
                 continue;
         }
         else if ( (node = next_node(node, nodemask)) >= MAX_NUMNODES )
             node = first_node(nodemask);
-        if ( node == first_node )
+        if ( node == first )
         {
             /* When we have tried all in nodemask, we fall back to others. */
             if ( (memflags & MEMF_exact_node) || nodemask_retry++ )
                 return NULL;
             nodes_andnot(nodemask, node_online_map, nodemask);
-            first_node = node = first_node(nodemask);
+            first = node = first_node(nodemask);
             if ( node >= MAX_NUMNODES )
                 return NULL;
         }