From: Muchun Song Date: Thu, 23 Feb 2023 06:59:47 +0000 (+0800) Subject: mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit X-Git-Tag: v6.6.17~4989^2~370 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12318566c5507a5ff4507d5bc5fe45895ffb0e05;p=platform%2Fkernel%2Flinux-rpi.git mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit The check of IS_ENABLED(CONFIG_PROC_SYSCTL) is unnecessary since register_sysctl_init() will be empty in this case. So, there is no warnings after removing the check. Link: https://lkml.kernel.org/r/20230223065947.64134-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Signed-off-by: Andrew Morton --- diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index a559037..a15cc56 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -590,17 +590,15 @@ static struct ctl_table hugetlb_vmemmap_sysctls[] = { static int __init hugetlb_vmemmap_init(void) { + const struct hstate *h; + /* HUGETLB_VMEMMAP_RESERVE_SIZE should cover all used struct pages */ BUILD_BUG_ON(__NR_USED_SUBPAGE * sizeof(struct page) > HUGETLB_VMEMMAP_RESERVE_SIZE); - if (IS_ENABLED(CONFIG_PROC_SYSCTL)) { - const struct hstate *h; - - for_each_hstate(h) { - if (hugetlb_vmemmap_optimizable(h)) { - register_sysctl_init("vm", hugetlb_vmemmap_sysctls); - break; - } + for_each_hstate(h) { + if (hugetlb_vmemmap_optimizable(h)) { + register_sysctl_init("vm", hugetlb_vmemmap_sysctls); + break; } } return 0;