summaryrefslogtreecommitdiff
path: root/mm/mm_init.c
diff options
context:
space:
mode:
authorHaifeng Xu <haifeng.xu@shopee.com>2023-06-07 03:24:02 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-06-19 16:19:04 -0700
commit91ff4d754a1895feb4216e94028edd76cbbc0770 (patch)
treedc0b3c47bead6660a7558572c0768070bcd7a0be /mm/mm_init.c
parentbd5f79ab39367665f40e10c2486aa15e7a841490 (diff)
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.com Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com> Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mm_init.c')
-rw-r--r--mm/mm_init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 015355dfdc0b..25a585cb0c0a 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -1724,7 +1724,7 @@ static void __init free_area_init_node(int nid)
}
/* 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;
@@ -1732,9 +1732,9 @@ static void check_for_memory(pg_data_t *pgdat, int nid)
struct zone *zone = &pgdat->node_zones[zone_type];
if (populated_zone(zone)) {
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)
- node_set_state(nid, N_NORMAL_MEMORY);
+ node_set_state(pgdat->node_id, N_NORMAL_MEMORY);
break;
}
}
@@ -1886,7 +1886,7 @@ void __init free_area_init(unsigned long *max_zone_pfn)
/* Any memory on that node */
if (pgdat->node_present_pages)
node_set_state(nid, N_MEMORY);
- check_for_memory(pgdat, nid);
+ check_for_memory(pgdat);
}
memmap_init();