* [PATCH] mm: compaction: remove incorrect #ifdef checks
@ 2023-03-29 8:02 Arnd Bergmann
2023-03-29 8:50 ` Luis Chamberlain
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-03-29 8:02 UTC (permalink / raw)
To: Andrew Morton, Luis Chamberlain, Minghao Chi, Vlastimil Babka
Cc: Arnd Bergmann, Miaohe Lin, Baolin Wang, Mel Gorman,
Matthew Wilcox (Oracle),
Kefeng Wang, NARIBAYASHI Akira, linux-mm, linux-kernel
From: Arnd Bergmann <arnd@arndb.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@arndb.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: compaction: remove incorrect #ifdef checks
2023-03-29 8:02 [PATCH] mm: compaction: remove incorrect #ifdef checks Arnd Bergmann
@ 2023-03-29 8:50 ` Luis Chamberlain
0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2023-03-29 8:50 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, Minghao Chi, Vlastimil Babka, Arnd Bergmann,
Miaohe Lin, Baolin Wang, Mel Gorman, Matthew Wilcox (Oracle),
Kefeng Wang, NARIBAYASHI Akira, linux-mm, linux-kernel
On Wed, Mar 29, 2023 at 10:02:41AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.de>
Thanks! Queued up.
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-29 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 8:02 [PATCH] mm: compaction: remove incorrect #ifdef checks Arnd Bergmann
2023-03-29 8:50 ` Luis Chamberlain
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.