printk/index: Fix -Wunused-function warning
authorYueHaibing <yuehaibing@huawei.com>
Wed, 4 Aug 2021 13:01:05 +0000 (21:01 +0800)
committerPetr Mladek <pmladek@suse.com>
Fri, 27 Aug 2021 14:42:44 +0000 (16:42 +0200)
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>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210804130105.18732-1-yuehaibing@huawei.com
kernel/printk/index.c

index 58d27272f992fc9aabb894edfccdbbf5d277a5ee..d3709408debe9ce708d0125f749f09b4f2af589e 100644 (file)
@@ -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)
 {