summaryrefslogtreecommitdiff
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-09-01 15:00:24 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-09-12 06:26:09 +0300
commit103956805c250ccef3d2a54a0a2e3354291cdd85 (patch)
tree79a74178f95481db4a237a0b0467fcdb10b17b77 /mm/hugetlb.c
parent3466534131b28e1ee1e7cfd5c77d981ea41b20aa (diff)
downloadlinux-103956805c250ccef3d2a54a0a2e3354291cdd85.tar.xz
hugetlb: use sizeof() to get the array size
It's better to use sizeof() to get the array size instead of manual calculation. Minor readability improvement. Link: https://lkml.kernel.org/r/20220901120030.63318-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index fddbda2a2b37..4d2efdfbd09d 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4149,11 +4149,11 @@ static void __init hugepages_clear_pages_in_node(void)
if (!hugetlb_max_hstate) {
default_hstate_max_huge_pages = 0;
memset(default_hugepages_in_node, 0,
- MAX_NUMNODES * sizeof(unsigned int));
+ sizeof(default_hugepages_in_node));
} else {
parsed_hstate->max_huge_pages = 0;
memset(parsed_hstate->max_huge_pages_node, 0,
- MAX_NUMNODES * sizeof(unsigned int));
+ sizeof(parsed_hstate->max_huge_pages_node));
}
}