From: YueHaibing Date: Wed, 4 Aug 2021 13:01:05 +0000 (+0800) Subject: printk/index: Fix -Wunused-function warning X-Git-Tag: v5.15-rc1~136^2~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc17bed5fd73ef1a9aed39f3b0ea26936dad60b8;p=thirdparty%2Fkernel%2Flinux.git printk/index: Fix -Wunused-function warning 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 Signed-off-by: YueHaibing Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210804130105.18732-1-yuehaibing@huawei.com --- diff --git a/kernel/printk/index.c b/kernel/printk/index.c index 58d27272f992f..d3709408debe9 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) {