Commit 91ff4d75 authored by Haifeng Xu's avatar Haifeng Xu Committed by Andrew Morton

mm/mm_init.c: drop 'nid' parameter from check_for_memory()

The node_id in pgdat has already been set in free_area_init_node(),
so use it internally instead of passing a redundant parameter.

Link: https://lkml.kernel.org/r/20230607032402.4679-1-haifeng.xu@shopee.comSigned-off-by: default avatarHaifeng Xu <haifeng.xu@shopee.com>
Reviewed-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent bd5f79ab
...@@ -1724,7 +1724,7 @@ static void __init free_area_init_node(int nid) ...@@ -1724,7 +1724,7 @@ static void __init free_area_init_node(int nid)
} }
/* Any regular or high memory on that node ? */ /* Any regular or high memory on that node ? */
static void check_for_memory(pg_data_t *pgdat, int nid) static void check_for_memory(pg_data_t *pgdat)
{ {
enum zone_type zone_type; enum zone_type zone_type;
...@@ -1732,9 +1732,9 @@ static void check_for_memory(pg_data_t *pgdat, int nid) ...@@ -1732,9 +1732,9 @@ static void check_for_memory(pg_data_t *pgdat, int nid)
struct zone *zone = &pgdat->node_zones[zone_type]; struct zone *zone = &pgdat->node_zones[zone_type];
if (populated_zone(zone)) { if (populated_zone(zone)) {
if (IS_ENABLED(CONFIG_HIGHMEM)) if (IS_ENABLED(CONFIG_HIGHMEM))
node_set_state(nid, N_HIGH_MEMORY); node_set_state(pgdat->node_id, N_HIGH_MEMORY);
if (zone_type <= ZONE_NORMAL) if (zone_type <= ZONE_NORMAL)
node_set_state(nid, N_NORMAL_MEMORY); node_set_state(pgdat->node_id, N_NORMAL_MEMORY);
break; break;
} }
} }
...@@ -1886,7 +1886,7 @@ void __init free_area_init(unsigned long *max_zone_pfn) ...@@ -1886,7 +1886,7 @@ void __init free_area_init(unsigned long *max_zone_pfn)
/* Any memory on that node */ /* Any memory on that node */
if (pgdat->node_present_pages) if (pgdat->node_present_pages)
node_set_state(nid, N_MEMORY); node_set_state(nid, N_MEMORY);
check_for_memory(pgdat, nid); check_for_memory(pgdat);
} }
memmap_init(); memmap_init();
......
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