From: Peng Liu Date: Thu, 14 Apr 2022 19:16:47 +0000 (-0700) Subject: hugetlb: clean up hugetlb_cma_reserve X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=41c7652174bba2af412d110bffb5a49af3b30205;p=users%2Fjedix%2Flinux-maple.git 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 --- 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];