mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
f2fs: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions. Fix the following coccicheck warning: fs/f2fs/sysfs.c:198:12-20: WARNING: use scnprintf or sprintf. fs/f2fs/sysfs.c:247:8-16: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang <wangqing@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
09631cf323
commit
84eab2a899
@ -196,7 +196,7 @@ static ssize_t encoding_show(struct f2fs_attr *a,
|
||||
struct super_block *sb = sbi->sb;
|
||||
|
||||
if (f2fs_sb_has_casefold(sbi))
|
||||
return snprintf(buf, PAGE_SIZE, "%s (%d.%d.%d)\n",
|
||||
return sysfs_emit(buf, "%s (%d.%d.%d)\n",
|
||||
sb->s_encoding->charset,
|
||||
(sb->s_encoding->version >> 16) & 0xff,
|
||||
(sb->s_encoding->version >> 8) & 0xff,
|
||||
@ -245,7 +245,7 @@ static ssize_t avg_vblocks_show(struct f2fs_attr *a,
|
||||
static ssize_t main_blkaddr_show(struct f2fs_attr *a,
|
||||
struct f2fs_sb_info *sbi, char *buf)
|
||||
{
|
||||
return snprintf(buf, PAGE_SIZE, "%llu\n",
|
||||
return sysfs_emit(buf, "%llu\n",
|
||||
(unsigned long long)MAIN_BLKADDR(sbi));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user