[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211203190123.874239-2-arnd@kernel.org>
Date: Fri, 3 Dec 2021 20:01:02 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Alexander Viro <viro@...iv.linux.org.uk>,
Luis Chamberlain <mcgrof@...nel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Arnd Bergmann <arnd@...db.de>, Jonathan Corbet <corbet@....net>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Hao Li <lihao2018.fnst@...fujitsu.com>,
Randy Dunlap <rdunlap@...radead.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] fs/dcache: avoid unused-function warning
From: Arnd Bergmann <arnd@...db.de>
Now that 'dentry_stat' is marked 'static', we can run into this warning:
fs/dcache.c:128:29: error: 'dentry_stat' defined but not used [-Werror=unused-variable]
128 | static struct dentry_stat_t dentry_stat = {
Hide it in the same #ifdef as its only references.
Fixes: f0eea17ca8da ("fs: move dcache sysctls to its own file")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
fs/dcache.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index 0eef1102f460..c84269c6e8bf 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -124,16 +124,15 @@ struct dentry_stat_t {
long dummy; /* Reserved for future use */
};
-/* Statistics gathering. */
-static struct dentry_stat_t dentry_stat = {
- .age_limit = 45,
-};
-
static DEFINE_PER_CPU(long, nr_dentry);
static DEFINE_PER_CPU(long, nr_dentry_unused);
static DEFINE_PER_CPU(long, nr_dentry_negative);
#if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
+/* Statistics gathering. */
+static struct dentry_stat_t dentry_stat = {
+ .age_limit = 45,
+};
/*
* Here we resort to our own counters instead of using generic per-cpu counters
--
2.29.2
Powered by blists - more mailing lists