f2fs: hide unused procfs helpers
PATCH 1/1 f2fs: hide unused procfs helpers
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.
--- fs/f2fs/sysfs.c | 2 ++ 1 file changed, 2 insertions(+)
fs/f2fs/sysfs.c +2 -0
@@ -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 ) {
Signature · 11 lines
2.7.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Hello,
Quoted 4 lines · YueHaibing
When
CONFIG_PROC_FSisn't set, gcc warning this:
fs/f2fs/sysfs.c:519:12: warning: ‘segment_info_seq_show’ defined but not used [-Wunused-function]
static intsegment_info_seq_show(struct seq_file *seq, void *offset)
Quoted 8 lines
^ 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 intiostat_info_seq_show(struct seq_file *seq, void *offset)We can fix the warning by adding the same #ifdef around them.
Could you check below patch sent from Randy Dunlap? It has already fixed this issue, anyway, thanks for your patch. :)
[PATCH] f2fs: fix defined but not used build warnings
Thanks,
Quoted 27 lines
Signed-off-by YueHaibing <[email protected]>--- fs/f2fs/sysfs.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/sysfs.c +2
-0@@ -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 ) {
Quoted 14 lines · Chao Yu
Hello,
Quoted 11 lines · YueHaibing
When
CONFIG_PROC_FSisn't set, gcc warning this:
fs/f2fs/sysfs.c:519:12: warning: ‘segment_info_seq_show’ defined but not used [-Wunused-function]
static intsegment_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 intiostat_info_seq_show(struct seq_file *seq, void *offset)
Quoted 6 lines
Quoted 1 line
We can fix the warning by adding the same #ifdef around them.
Could you check below patch sent from Randy Dunlap? It has already fixed this issue, anyway, thanks for your patch. :)
[PATCH] f2fs: fix defined but not used build warnings
thank you for your information.
Quoted 34 lines
Thanks,
Quoted 20 lines
Signed-off-by YueHaibing <[email protected]>--- fs/f2fs/sysfs.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/sysfs.c +1
-0@@ -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;fs/f2fs/sysfs.c static int iostat_info_seq_show(struct seq_file *seq, void *offset) · line 615
Quoted 7 lines
fs/f2fs/sysfs.c +1
-0@@ -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 ) {.