Skip to content

Commit b3f312c

Browse files
arndbmcgrof
authored andcommitted
mm: compaction: remove incorrect #ifdef checks
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: c521126 ("mm: compaction: move compaction sysctl to its own file") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent 48fe8ab commit b3f312c

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

mm/compaction.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,7 +3080,6 @@ static int proc_dointvec_minmax_warn_RT_change(struct ctl_table *table,
30803080
return ret;
30813081
}
30823082

3083-
#ifdef CONFIG_SYSCTL
30843083
static struct ctl_table vm_compaction[] = {
30853084
{
30863085
.procname = "compact_memory",
@@ -3118,7 +3117,6 @@ static struct ctl_table vm_compaction[] = {
31183117
},
31193118
{ }
31203119
};
3121-
#endif
31223120

31233121
static int __init kcompactd_init(void)
31243122
{
@@ -3135,9 +3133,7 @@ static int __init kcompactd_init(void)
31353133

31363134
for_each_node_state(nid, N_MEMORY)
31373135
kcompactd_run(nid);
3138-
#ifdef CONFIG_SYSCTL
31393136
register_sysctl_init("vm", vm_compaction);
3140-
#endif
31413137
return 0;
31423138
}
31433139
subsys_initcall(kcompactd_init)

0 commit comments

Comments
 (0)