lkml.org 
[lkml]   [2018]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] f2fs: hide unused procfs helpers
Date
When CONFIG_PROC_FS isn't set, gcc warning this:

fs/f2fs/sysfs.c:519:12: warning: ‘segment_info_seq_show’ defined but not used [-Wunused-function]
static int segment_info_seq_show(struct seq_file *seq, void *offset)
^
fs/f2fs/sysfs.c:546:12: warning: ‘segment_bits_seq_show’ defined but not used [-Wunused-function]
static int segment_bits_seq_show(struct seq_file *seq, void *offset)
^
fs/f2fs/sysfs.c:570:12: warning: ‘iostat_info_seq_show’ defined but not used [-Wunused-function]
static int iostat_info_seq_show(struct seq_file *seq, void *offset)

We can fix the warning by adding the same #ifdef around them.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
fs/f2fs/sysfs.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 2e7e611..7d45e65 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -516,6 +516,7 @@ static struct kobject f2fs_feat = {
.kset = &f2fs_kset,
};

+#ifdef CONFIG_PROC_FS
static int segment_info_seq_show(struct seq_file *seq, void *offset)
{
struct super_block *sb = seq->private;
@@ -608,6 +609,7 @@ static int iostat_info_seq_show(struct seq_file *seq, void *offset)

return 0;
}
+#endif

int __init f2fs_init_sysfs(void)
{
--
2.7.0

\
 
 \ /
  Last update: 2018-07-15 22:06    [W:0.042 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site