linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Vlastimil Babka <vbabka@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>, Miaohe Lin <linmiaohe@huawei.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	NARIBAYASHI Akira <a.naribayashi@fujitsu.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm: compaction: remove incorrect #ifdef checks
Date: Wed, 29 Mar 2023 10:02:41 +0200	[thread overview]
Message-ID: <20230329080248.2543492-1-arnd@kernel.org> (raw)

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



             reply	other threads:[~2023-03-29  8:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  8:02 Arnd Bergmann [this message]
2023-03-29  8:50 ` [PATCH] mm: compaction: remove incorrect #ifdef checks Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230329080248.2543492-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=a.naribayashi@fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=vbabka@suse.cz \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).