Commit 10395680 authored by Miaohe Lin's avatar Miaohe Lin Committed by Andrew Morton

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.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarMuchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 34665341
...@@ -4149,11 +4149,11 @@ static void __init hugepages_clear_pages_in_node(void) ...@@ -4149,11 +4149,11 @@ static void __init hugepages_clear_pages_in_node(void)
if (!hugetlb_max_hstate) { if (!hugetlb_max_hstate) {
default_hstate_max_huge_pages = 0; default_hstate_max_huge_pages = 0;
memset(default_hugepages_in_node, 0, memset(default_hugepages_in_node, 0,
MAX_NUMNODES * sizeof(unsigned int)); sizeof(default_hugepages_in_node));
} else { } else {
parsed_hstate->max_huge_pages = 0; parsed_hstate->max_huge_pages = 0;
memset(parsed_hstate->max_huge_pages_node, 0, memset(parsed_hstate->max_huge_pages_node, 0,
MAX_NUMNODES * sizeof(unsigned int)); sizeof(parsed_hstate->max_huge_pages_node));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment