linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] printk/index: Fix -Wunused-function warning
@ 2021-08-04 13:01 YueHaibing
  2021-08-27 14:47 ` Petr Mladek
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2021-08-04 13:01 UTC (permalink / raw)
  To: chris, pmladek, senozhatsky, rostedt, john.ogness
  Cc: linux-kernel, YueHaibing

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] printk/index: Fix -Wunused-function warning
  2021-08-04 13:01 [PATCH -next] printk/index: Fix -Wunused-function warning YueHaibing
@ 2021-08-27 14:47 ` Petr Mladek
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Mladek @ 2021-08-27 14:47 UTC (permalink / raw)
  To: YueHaibing; +Cc: chris, senozhatsky, rostedt, john.ogness, linux-kernel

On Wed 2021-08-04 21:01:05, YueHaibing wrote:
> 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>

The patch has been committed into printk/linux.git,
branch for-5.15-printk-index.

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-27 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 13:01 [PATCH -next] printk/index: Fix -Wunused-function warning YueHaibing
2021-08-27 14:47 ` Petr Mladek

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).