Commit bc732f1d authored by Zhang Yanfei's avatar Zhang Yanfei Committed by Linus Torvalds

mm/page_alloc.c: remove zone_type argument of build_zonelists_node

The callers of build_zonelists_node always pass MAX_NR_ZONES -1 as the
zone_type argument, so we can directly use the value in
build_zonelists_node and remove zone_type argument.
Signed-off-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0cf31ec1
...@@ -3153,12 +3153,10 @@ static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) ...@@ -3153,12 +3153,10 @@ static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref)
* Add all populated zones of a node to the zonelist. * Add all populated zones of a node to the zonelist.
*/ */
static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist, static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist,
int nr_zones, enum zone_type zone_type) int nr_zones)
{ {
struct zone *zone; struct zone *zone;
enum zone_type zone_type = MAX_NR_ZONES;
BUG_ON(zone_type >= MAX_NR_ZONES);
zone_type++;
do { do {
zone_type--; zone_type--;
...@@ -3168,8 +3166,8 @@ static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist, ...@@ -3168,8 +3166,8 @@ static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist,
&zonelist->_zonerefs[nr_zones++]); &zonelist->_zonerefs[nr_zones++]);
check_highest_zone(zone_type); check_highest_zone(zone_type);
} }
} while (zone_type); } while (zone_type);
return nr_zones; return nr_zones;
} }
...@@ -3363,8 +3361,7 @@ static void build_zonelists_in_node_order(pg_data_t *pgdat, int node) ...@@ -3363,8 +3361,7 @@ static void build_zonelists_in_node_order(pg_data_t *pgdat, int node)
zonelist = &pgdat->node_zonelists[0]; zonelist = &pgdat->node_zonelists[0];
for (j = 0; zonelist->_zonerefs[j].zone != NULL; j++) for (j = 0; zonelist->_zonerefs[j].zone != NULL; j++)
; ;
j = build_zonelists_node(NODE_DATA(node), zonelist, j, j = build_zonelists_node(NODE_DATA(node), zonelist, j);
MAX_NR_ZONES - 1);
zonelist->_zonerefs[j].zone = NULL; zonelist->_zonerefs[j].zone = NULL;
zonelist->_zonerefs[j].zone_idx = 0; zonelist->_zonerefs[j].zone_idx = 0;
} }
...@@ -3378,7 +3375,7 @@ static void build_thisnode_zonelists(pg_data_t *pgdat) ...@@ -3378,7 +3375,7 @@ static void build_thisnode_zonelists(pg_data_t *pgdat)
struct zonelist *zonelist; struct zonelist *zonelist;
zonelist = &pgdat->node_zonelists[1]; zonelist = &pgdat->node_zonelists[1];
j = build_zonelists_node(pgdat, zonelist, 0, MAX_NR_ZONES - 1); j = build_zonelists_node(pgdat, zonelist, 0);
zonelist->_zonerefs[j].zone = NULL; zonelist->_zonerefs[j].zone = NULL;
zonelist->_zonerefs[j].zone_idx = 0; zonelist->_zonerefs[j].zone_idx = 0;
} }
...@@ -3586,7 +3583,7 @@ static void build_zonelists(pg_data_t *pgdat) ...@@ -3586,7 +3583,7 @@ static void build_zonelists(pg_data_t *pgdat)
local_node = pgdat->node_id; local_node = pgdat->node_id;
zonelist = &pgdat->node_zonelists[0]; zonelist = &pgdat->node_zonelists[0];
j = build_zonelists_node(pgdat, zonelist, 0, MAX_NR_ZONES - 1); j = build_zonelists_node(pgdat, zonelist, 0);
/* /*
* Now we build the zonelist so that it contains the zones * Now we build the zonelist so that it contains the zones
...@@ -3599,14 +3596,12 @@ static void build_zonelists(pg_data_t *pgdat) ...@@ -3599,14 +3596,12 @@ static void build_zonelists(pg_data_t *pgdat)
for (node = local_node + 1; node < MAX_NUMNODES; node++) { for (node = local_node + 1; node < MAX_NUMNODES; node++) {
if (!node_online(node)) if (!node_online(node))
continue; continue;
j = build_zonelists_node(NODE_DATA(node), zonelist, j, j = build_zonelists_node(NODE_DATA(node), zonelist, j);
MAX_NR_ZONES - 1);
} }
for (node = 0; node < local_node; node++) { for (node = 0; node < local_node; node++) {
if (!node_online(node)) if (!node_online(node))
continue; continue;
j = build_zonelists_node(NODE_DATA(node), zonelist, j, j = build_zonelists_node(NODE_DATA(node), zonelist, j);
MAX_NR_ZONES - 1);
} }
zonelist->_zonerefs[j].zone = NULL; zonelist->_zonerefs[j].zone = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment