[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230329080248.2543492-1-arnd@kernel.org>
Date: Wed, 29 Mar 2023 10:02:41 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Minghao Chi <chi.minghao@....com.cn>,
Vlastimil Babka <vbabka@...e.cz>
Cc: Arnd Bergmann <arnd@...db.de>, Miaohe Lin <linmiaohe@...wei.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Mel Gorman <mgorman@...hsingularity.net>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
NARIBAYASHI Akira <a.naribayashi@...itsu.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mm: compaction: remove incorrect #ifdef checks
From: Arnd Bergmann <arnd@...db.de>
Without CONFIG_SYSCTL, the compiler warns about a few unused functions:
mm/compaction.c:3076:12: error: 'proc_dointvec_minmax_warn_RT_change' defined but not used [-Werror=unused-function]
mm/compaction.c:2780:12: error: 'sysctl_compaction_handler' defined but not used [-Werror=unused-function]
mm/compaction.c:2750:12: error: 'compaction_proactiveness_sysctl_handler' defined but not used [-Werror=unused-function]
The #ifdef is actually not necessary here, as the alternative
register_sysctl_init() stub function does not use its argument, which
lets the compiler drop the rest implicitly, while avoiding the warning.
Fixes: c521126610c3 ("mm: compaction: move compaction sysctl to its own file")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
mm/compaction.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 3dfdb84b9c98..c8bcdea15f5f 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -3092,7 +3092,6 @@ static int proc_dointvec_minmax_warn_RT_change(struct ctl_table *table,
return ret;
}
-#ifdef CONFIG_SYSCTL
static struct ctl_table vm_compaction[] = {
{
.procname = "compact_memory",
@@ -3130,7 +3129,6 @@ static struct ctl_table vm_compaction[] = {
},
{ }
};
-#endif
static int __init kcompactd_init(void)
{
@@ -3147,9 +3145,7 @@ static int __init kcompactd_init(void)
for_each_node_state(nid, N_MEMORY)
kcompactd_run(nid);
-#ifdef CONFIG_SYSCTL
register_sysctl_init("vm", vm_compaction);
-#endif
return 0;
}
subsys_initcall(kcompactd_init)
--
2.39.2
Powered by blists - more mailing lists