]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
hugetlb: clean up hugetlb_cma_reserve
authorPeng Liu <liupeng256@huawei.com>
Thu, 14 Apr 2022 19:16:47 +0000 (12:16 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 14 Apr 2022 21:49:50 +0000 (17:49 -0400)
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 <liupeng256@huawei.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Liu Yuntao <liuyuntao10@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Zhenguo Yao <yaozhenguo1@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c

index e60859ef19448538b991caf3f4f283720a1040c5..60a75c0768d96ed097a6f15442727bfa6daa25af 100644 (file)
@@ -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];