Re: [PATCH] smb: client: hide unused cifs_debug_dirs_proc_ops

Enzo Matsumiya <[email protected]> Thu, 23 Apr 2026 11:01:39 +0200
Newsgroups gmane.linux.kernel,gmane.linux.kernel.cifs,gmane.network.samba.internals
Message-ID <mrqkpq5tp3pair2gkvgfvkf2gfniav4npp5phd6qv4j36oce6o@j4zwqqzbqjir>
On 04/23, Arnd Bergmann wrote:
>From: Arnd Bergmann <[email protected]>
>
>When CONFIG_CIFS_DEBUG2 is disabled, the only reference to this
>function is hidden, causing a harmless warning:
>
>fs/smb/client/cifs_debug.c:395:30: error: 'cifs_debug_dirs_proc_ops' defined but not used [-Werror=unused-const-variable=]
>  395 | static const struct proc_ops cifs_debug_dirs_proc_ops = {
>      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
>
>Make the #ifdef checks around them consistent by always using
>the DEBUG2 variant.
>
>Fixes: 63bff18d4aa0 ("smb: client: fix (remove) drop_dir_cache module parameter")

Thanks for catching that.

I sent v2/v3 of that patch changing the dependency from
CONFIG_CIFS_DEBUG2 to CONFIG_CIFS_DEBUG, can you adjust to the
latter please?


Cheers,

>Signed-off-by: Arnd Bergmann <[email protected]>
>---
> fs/smb/client/cifs_debug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c
>index f55e5cabdaee..9a2e796161d0 100644
>--- a/fs/smb/client/cifs_debug.c
>+++ b/fs/smb/client/cifs_debug.c
>@@ -306,7 +306,7 @@ static int cifs_debug_dirs_proc_show(struct seq_file *m, void *v)
> 	LIST_HEAD(entry);
>
> 	seq_puts(m, "# Version:1\n");
>-#ifdef CONFIG_CIFS_DEBUG
>+#ifdef CONFIG_CIFS_DEBUG2
> 	seq_puts(m, "# Write 0 to this file to drop all cached directory entries\n");
> #endif /* CONFIG_CIFS_DEBUG */
> 	seq_puts(m, "# Format:\n");
>@@ -356,7 +356,7 @@ static int cifs_debug_dirs_proc_show(struct seq_file *m, void *v)
> 	return 0;
> }
>
>-#ifdef CONFIG_CIFS_DEBUG
>+#ifdef CONFIG_CIFS_DEBUG2
> static int cifs_debug_dirs_proc_open(struct inode *inode, struct file *file)
> {
> 	return single_open(file, cifs_debug_dirs_proc_show, NULL);
>-- 
>2.39.5
>
>