[1/3] page-alloc: Rename the first_node local variable
diff mbox series

Message ID 20190625144350.6176-2-andrew.cooper3@citrix.com
State New
Headers show
Series
  • nodemask: API cleanup and fixes
Related show

Commit Message

Andrew Cooper June 25, 2019, 2:43 p.m. UTC
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>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>

v2:
 * New
---
 xen/common/page_alloc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Jan Beulich June 25, 2019, 3:37 p.m. UTC | #1
>>> On 25.06.19 at 16:43, <andrew.cooper3@citrix.com> wrote:
> 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>

Patch
diff mbox series

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;
         }