diff options
author | 2022-04-29 14:36:58 -0700 | |
---|---|---|
committer | 2022-04-29 14:36:58 -0700 | |
commit | 30a514002db23fd630e3e52a2bdfb05c0de03378 (patch) | |
tree | 5edd15146803fa92b7654e6bd2cef61211f5a188 /mm/hugetlb.c | |
parent | hugetlb: fix return value of __setup handlers (diff) | |
download | linux-30a514002db23fd630e3e52a2bdfb05c0de03378.tar.gz linux-30a514002db23fd630e3e52a2bdfb05c0de03378.tar.bz2 linux-30a514002db23fd630e3e52a2bdfb05c0de03378.zip |
mm: use for_each_online_node and node_online instead of open coding
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/20220429030218.644635-1-liupeng256@huawei.com
Signed-off-by: Peng Liu <liupeng256@huawei.com>
Suggested-by: Davidlohr Bueso <dave@stgolabs.net>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 15b9faeb87ef..4ab62657acda 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6971,7 +6971,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; @@ -7010,7 +7010,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]; |