From: Arnd Bergmann <arnd@kernel.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Luis Chamberlain <mcgrof@kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Christian Brauner <christian.brauner@ubuntu.com>,
Jan Kara <jack@suse.cz>,
James Morris <jamorris@linux.microsoft.com>,
Johannes Weiner <hannes@cmpxchg.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Eric Biggers <ebiggers@google.com>,
Miklos Szeredi <mszeredi@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] fs/inode: avoid unused-variable warning
Date: Fri, 3 Dec 2021 20:01:01 +0100 [thread overview]
Message-ID: <20211203190123.874239-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
Now that 'inodes_stat' is marked 'static', it causes a harmless warning
whenever it is unused:
fs/inode.c:73:29: error: 'inodes_stat' defined but not used [-Werror=unused-variable]
73 | static struct inodes_stat_t inodes_stat;
Move it into the #ifdef that guards its only references.
Fixes: 245314851782 ("fs: move inode sysctls to its own file")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/inode.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/inode.c b/fs/inode.c
index bef6ba9b8eb4..63324df6fa27 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -67,11 +67,6 @@ const struct address_space_operations empty_aops = {
};
EXPORT_SYMBOL(empty_aops);
-/*
- * Statistics gathering..
- */
-static struct inodes_stat_t inodes_stat;
-
static DEFINE_PER_CPU(unsigned long, nr_inodes);
static DEFINE_PER_CPU(unsigned long, nr_unused);
@@ -106,6 +101,11 @@ long get_nr_dirty_inodes(void)
* Handle nr_inode sysctl
*/
#ifdef CONFIG_SYSCTL
+/*
+ * Statistics gathering..
+ */
+static struct inodes_stat_t inodes_stat;
+
static int proc_nr_inodes(struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos)
{
--
2.29.2
next reply other threads:[~2021-12-03 19:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 19:01 Arnd Bergmann [this message]
2021-12-03 19:01 ` [PATCH 2/2] fs/dcache: avoid unused-function warning Arnd Bergmann
2021-12-04 11:57 ` Christian Brauner
2021-12-04 11:56 ` [PATCH 1/2] fs/inode: avoid unused-variable warning Christian Brauner
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=20211203190123.874239-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=christian.brauner@ubuntu.com \
--cc=ebiggers@google.com \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=jamorris@linux.microsoft.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mszeredi@redhat.com \
--cc=sfr@canb.auug.org.au \
--cc=viro@zeniv.linux.org.uk \
--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).