Skip to contentSkip to conversation

xfs, proc: hide unused xfs procfs helpers

PATCH In review Arnd Bergmann 3 participants 3 messages May 25, 2018 – May 26, 2018 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs, proc: hide unused xfs procfs helpers

These two functions now trigger a warning when CONFIG_PROC_FS is disabled:

fs/xfs/xfs_stats.c:128:12: error: 'xqmstat_proc_show' defined but not used [-Werror=unused-function]
static int xqmstat_proc_show(struct seq_file *m, void *v)

            ^~~~~~~~~~~~~~~~~
fs/xfs/xfs_stats.c:118:12: error: 'xqm_proc_show' defined but not used [-Werror=unused-function]
 static int xqm_proc_show(struct seq_file *m, void *v)
            ^~~~~~~~~~~~~

Previously, they were referenced from an unused 'static const' structure, which is silently dropped by gcc.

We can address the warning by adding the same #ifdef around them that hides the reference.

Fixes 3f3942aca6da ("proc: introduce proc_create_single{,_data}")
Cc Christoph Hellwig <[email protected]>

---
The warning was caused by a patch in Al's VFS tree, so the fix needs to go through the same one.

---
 fs/xfs/xfs_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_stats.c +1 -1
index 04762a72e344..1cc79907b377 100644
@@ -113,6 +113,7 @@ void xfs_stats_clearall(struct xfsstats __percpu *stats)
 	}
 }
 
+#ifdef CONFIG_PROC_FS
 /* legacy quota interfaces */
 #ifdef CONFIG_XFS_QUOTA
 static int xqm_proc_show(struct seq_file *m, void *v)
@@ -137,7 +138,6 @@ static int xqmstat_proc_show(struct seq_file *m, void *v)
 }
 #endif /* CONFIG_XFS_QUOTA */
 
-#ifdef CONFIG_PROC_FS
 int
 xfs_init_procfs(void)
 {
Signature · 1 line
2.9.0