From 41c7652174bba2af412d110bffb5a49af3b30205 Mon Sep 17 00:00:00 2001 From: Peng Liu Date: Thu, 14 Apr 2022 12:16:47 -0700 Subject: [PATCH] hugetlb: clean up hugetlb_cma_reserve Use more generic functions to deal with issues related to online nodes. The changes will make the code simplified. Link: https://lkml.kernel.org/r/20220413032915.251254-5-liupeng256@huawei.com Signed-off-by: Peng Liu Cc: Baolin Wang Cc: David Hildenbrand Cc: Liu Yuntao Cc: Mike Kravetz Cc: Muchun Song Cc: Zhenguo Yao Signed-off-by: Andrew Morton --- mm/hugetlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e60859ef1944..60a75c0768d9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7026,7 +7026,7 @@ void __init hugetlb_cma_reserve(int order) if (hugetlb_cma_size_in_node[nid] == 0) continue; - if (!node_state(nid, N_ONLINE)) { + if (!node_online(nid)) { pr_warn("hugetlb_cma: invalid node %d specified\n", nid); hugetlb_cma_size -= hugetlb_cma_size_in_node[nid]; hugetlb_cma_size_in_node[nid] = 0; @@ -7065,7 +7065,7 @@ void __init hugetlb_cma_reserve(int order) } reserved = 0; - for_each_node_state(nid, N_ONLINE) { + for_each_online_node(nid) { int res; char name[CMA_MAX_NAME]; -- 2.50.1