[PATCH] f2fs: fix some format WARNING in super.c

From: Yangtao Li
Date: Thu Feb 02 2023 - 02:03:18 EST


To fix:

WARNING: It's generally not useful to have the filename in the file
+ * fs/f2fs/super.c

WARNING: quoted string split across lines
+ f2fs_warn(sbi, "using deprecated layout of large_nat_bitmap, "
+ "please run fsck v1.13.0 or higher to repair, chksum_offset: %u, "

WARNING: quoted string split across lines
+ "please run fsck v1.13.0 or higher to repair, chksum_offset: %u, "
+ "fixed with patch: \"f2fs-tools: relocate chksum_offset for large_nat_bitmap feature\"",

WARNING: quoted string split across lines
+ "can't mount with superblock charset: %s-%u.%u.%u "
+ "not supported by the kernel. flags: 0x%x.",

WARNING: quoted string split across lines
+ f2fs_info(sbi, "Using encoding defined by superblock: "
+ "%s-%u.%u.%u with flags 0x%hx", encoding_info->name,

WARNING: quoted string split across lines
+ f2fs_err(sbi, "Need to recover fsync data, but "
+ "write access unavailable, please try "

WARNING: quoted string split across lines
+ "write access unavailable, please try "
+ "mount w/ disable_roll_forward or norecovery");

WARNING: printk() should include KERN_<LEVEL> facility level
+ printk("F2FS not supported on PAGE_SIZE(%lu) != %d\n",

Signed-off-by: Yangtao Li <frank.li@xxxxxxxx>
---
fs/f2fs/super.c | 37 +++++++++++++++----------------------
1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index fddff5deaed2..6f65beec78ff 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * fs/f2fs/super.c
- *
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*/
+
+#define pr_fmt(fmt) "F2FS: " fmt
+
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
@@ -3584,9 +3585,9 @@ int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi)

if (__is_set_ckpt_flags(ckpt, CP_LARGE_NAT_BITMAP_FLAG) &&
le32_to_cpu(ckpt->checksum_offset) != CP_MIN_CHKSUM_OFFSET) {
- f2fs_warn(sbi, "using deprecated layout of large_nat_bitmap, "
- "please run fsck v1.13.0 or higher to repair, chksum_offset: %u, "
- "fixed with patch: \"f2fs-tools: relocate chksum_offset for large_nat_bitmap feature\"",
+ f2fs_warn(sbi, "using deprecated layout of large_nat_bitmap\n"
+ " please run fsck v1.13.0 or higher to repair, chksum_offset: %u\n"
+ " fixed with patch: \"f2fs-tools: relocate chksum_offset for large_nat_bitmap feature\"",
le32_to_cpu(ckpt->checksum_offset));
return 1;
}
@@ -4048,20 +4049,15 @@ static int f2fs_setup_casefold(struct f2fs_sb_info *sbi)
encoding = utf8_load(encoding_info->version);
if (IS_ERR(encoding)) {
f2fs_err(sbi,
- "can't mount with superblock charset: %s-%u.%u.%u "
- "not supported by the kernel. flags: 0x%x.",
- encoding_info->name,
- unicode_major(encoding_info->version),
+ "can't mount with superblock charset: %s-%u.%u.%u not supported by the kernel. flags: 0x%x.",
+ encoding_info->name, unicode_major(encoding_info->version),
unicode_minor(encoding_info->version),
- unicode_rev(encoding_info->version),
- encoding_flags);
+ unicode_rev(encoding_info->version), encoding_flags);
return PTR_ERR(encoding);
}
- f2fs_info(sbi, "Using encoding defined by superblock: "
- "%s-%u.%u.%u with flags 0x%hx", encoding_info->name,
- unicode_major(encoding_info->version),
- unicode_minor(encoding_info->version),
- unicode_rev(encoding_info->version),
+ f2fs_info(sbi, "Using encoding defined by superblock: %s-%u.%u.%u with flags 0x%hx",
+ encoding_info->name, unicode_major(encoding_info->version),
+ unicode_minor(encoding_info->version), unicode_rev(encoding_info->version),
encoding_flags);

sbi->sb->s_encoding = encoding;
@@ -4415,9 +4411,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
err = f2fs_recover_fsync_data(sbi, true);
if (err > 0) {
err = -EROFS;
- f2fs_err(sbi, "Need to recover fsync data, but "
- "write access unavailable, please try "
- "mount w/ disable_roll_forward or norecovery");
+ f2fs_err(sbi, "Need to recover fsync data, but write access unavailable\n"
+ " please try mount w/ disable_roll_forward or norecovery");
}
if (err < 0)
goto free_meta;
@@ -4666,8 +4661,7 @@ static int __init init_f2fs_fs(void)
int err;

if (PAGE_SIZE != F2FS_BLKSIZE) {
- printk("F2FS not supported on PAGE_SIZE(%lu) != %d\n",
- PAGE_SIZE, F2FS_BLKSIZE);
+ pr_err("not supported on PAGE_SIZE(%lu) != %d\n", PAGE_SIZE, F2FS_BLKSIZE);
return -EINVAL;
}

@@ -4790,4 +4784,3 @@ MODULE_AUTHOR("Samsung Electronics's Praesto Team");
MODULE_DESCRIPTION("Flash Friendly File System");
MODULE_LICENSE("GPL");
MODULE_SOFTDEP("pre: crc32");
-
--
2.25.1