LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <chris@chrisdown.name>, <pmladek@suse.com>,
<senozhatsky@chromium.org>, <rostedt@goodmis.org>,
<john.ogness@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH -next] printk/index: Fix -Wunused-function warning
Date: Wed, 4 Aug 2021 21:01:05 +0800 [thread overview]
Message-ID: <20210804130105.18732-1-yuehaibing@huawei.com> (raw)
If CONFIG_MODULES is n, we got this:
kernel/printk/index.c:146:13: warning: ‘pi_remove_file’ defined but not used [-Wunused-function]
Move it inside #ifdef block to fix this warning.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
kernel/printk/index.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/printk/index.c b/kernel/printk/index.c
index 58d27272f992..d3709408debe 100644
--- a/kernel/printk/index.c
+++ b/kernel/printk/index.c
@@ -143,12 +143,12 @@ static void pi_create_file(struct module *mod)
mod, &dfs_index_fops);
}
+#ifdef CONFIG_MODULES
static void pi_remove_file(struct module *mod)
{
debugfs_remove(debugfs_lookup(pi_get_module_name(mod), dfs_index));
}
-#ifdef CONFIG_MODULES
static int pi_module_notify(struct notifier_block *nb, unsigned long op,
void *data)
{
--
2.17.1
next reply other threads:[~2021-08-04 13:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 13:01 YueHaibing [this message]
2021-08-27 14:47 ` Petr Mladek
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=20210804130105.18732-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=chris@chrisdown.name \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--subject='Re: [PATCH -next] printk/index: Fix -Wunused-function warning' \
/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
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).