[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] page-alloc: Rename the first_node local variable



commit 7aac8e81dfe7611f3953f41f5e92498ea6efd261
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Jun 25 14:07:23 2019 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jun 27 18:50:41 2019 +0100

    page-alloc: Rename the first_node local variable
    
    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@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/page_alloc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 7825fd8c42..7bbb44f7d1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -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;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.