Skip to contentSkip to conversation

fuse: dev: avoid a build warning when PROC_FS is not set

PATCH In review Randy Dunlap 3 participants 3 messages May 14, 2025 – May 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fuse: dev: avoid a build warning when PROC_FS is not set

Fix a build warning when CONFIG_PROC_FS is not set by surrounding the function with #ifdef CONFIG_PROC_FS.

fs/fuse/dev.c:2620:13: warning: 'fuse_dev_show_fdinfo' defined but not used [-Wunused-function]
2620 | static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)

Fixes 514d9210bf45 ("fs: fuse: add dev id to /dev/fuse fdinfo")
Cc Miklos Szeredi <[email protected]>
Cc Miklos Szeredi <[email protected]>
Cc Chen Linxuan <[email protected]>
---
 fs/fuse/dev.c |    2 ++
 1 file changed, 2 insertions(+)
fs/fuse/dev.c +2 -0
@@ -2617,6 +2617,7 @@ static long fuse_dev_ioctl(struct file *
 	}
 }
 
+#ifdef CONFIG_PROC_FS
 static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)
 {
 	struct fuse_dev *fud = fuse_get_dev(file);
@@ -2625,6 +2626,7 @@ static void fuse_dev_show_fdinfo(struct
 
 	seq_printf(seq, "fuse_connection:\t%u\n", fud->fc->dev);
 }
+#endif
 
 const struct file_operations fuse_dev_operations = {
 	.owner		= THIS_MODULE,
Reviewed-by on v1 1/1
#1 lore raw
Quoted 37 lines · Randy Dunlap

Fix a build warning when CONFIG_PROC_FS is not set by surrounding the function with #ifdef CONFIG_PROC_FS.

fs/fuse/dev.c:2620:13: warning: 'fuse_dev_show_fdinfo' defined but not used [-Wunused-function]
2620 | static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)

Fixes 514d9210bf45 ("fs: fuse: add dev id to /dev/fuse fdinfo")
Cc Miklos Szeredi <[email protected]>
Cc Miklos Szeredi <[email protected]>
Cc Chen Linxuan <[email protected]>
---
 fs/fuse/dev.c |    2 ++
 1 file changed, 2 insertions(+)
fs/fuse/dev.c +2 -0
@@ -2617,6 +2617,7 @@ static long fuse_dev_ioctl(struct file *
        }
 }
 
+#ifdef CONFIG_PROC_FS
 static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)
 {
        struct fuse_dev *fud = fuse_get_dev(file);
@@ -2625,6 +2626,7 @@ static void fuse_dev_show_fdinfo(struct
 
        seq_printf(seq, "fuse_connection:\t%u\n", fud->fc->dev);
 }
+#endif
 
 const struct file_operations fuse_dev_operations = {
        .owner          = THIS_MODULE,
maintainer
#2 lore raw
In reply to Randy Dunlap
Quoted 9 lines · Randy Dunlap

Fix a build warning when CONFIG_PROC_FS is not set by surrounding the function with #ifdef CONFIG_PROC_FS.

fs/fuse/dev.c:2620:13: warning: 'fuse_dev_show_fdinfo' defined but not used [-Wunused-function]
2620 | static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)

Fixes 514d9210bf45 ("fs: fuse: add dev id to /dev/fuse fdinfo")

Folded, thanks.

Miklos