linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit
@ 2023-02-23  6:59 Muchun Song
  2023-02-24  0:52 ` Mike Kravetz
  0 siblings, 1 reply; 2+ messages in thread
From: Muchun Song @ 2023-02-23  6:59 UTC (permalink / raw)
  To: mike.kravetz, akpm, muchun.song; +Cc: linux-mm, linux-kernel, Muchun Song

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.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb_vmemmap.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index 45e93a545dd7..274b91d408c3 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;
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit
  2023-02-23  6:59 [PATCH] mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit Muchun Song
@ 2023-02-24  0:52 ` Mike Kravetz
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Kravetz @ 2023-02-24  0:52 UTC (permalink / raw)
  To: Muchun Song; +Cc: akpm, muchun.song, linux-mm, linux-kernel

On 02/23/23 14:59, Muchun Song wrote:
> 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.
> 
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> ---
>  mm/hugetlb_vmemmap.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)

Thanks,

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

-- 
Mike Kravetz


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-24  0:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-23  6:59 [PATCH] mm: hugetlb_vmemmap: simplify hugetlb_vmemmap_init() a bit Muchun Song
2023-02-24  0:52 ` Mike Kravetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).