Skip to contentSkip to conversation

exfat: Remove unnecessary newlines from logging

PATCH In review Joe Perches 2 participants 2 messages Mar 17, 2020 – Mar 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exfat: Remove unnecessary newlines from logging

None of these message formats should end in a newline as exfat_msg and its callers already appends messages with one.

Miscellanea:

o Remove unnecessary trailing periods from formats.

---
 fs/exfat/dir.c    | 4 ++--
 fs/exfat/fatent.c | 8 ++++----
 fs/exfat/file.c   | 2 +-
 fs/exfat/inode.c  | 6 +++---
 fs/exfat/misc.c   | 2 +-
 fs/exfat/nls.c    | 4 ++--
 fs/exfat/super.c  | 4 ++--
 7 files changed, 15 insertions(+), 15 deletions(-)
fs/exfat/dir.c +2 -2
index 4b91af..a213520 100644
@@ -750,7 +750,7 @@ struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
 	sector_t sec;
 
 	if (p_dir->dir == DIR_DELETED) {
-		exfat_msg(sb, KERN_ERR, "abnormal access to deleted dentry\n");
+		exfat_msg(sb, KERN_ERR, "abnormal access to deleted dentry");
 		return NULL;
 	}
 
@@ -853,7 +853,7 @@ struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb,
 	struct buffer_head *bh;
 
 	if (p_dir->dir == DIR_DELETED) {
-		exfat_msg(sb, KERN_ERR, "access to deleted dentry\n");
+		exfat_msg(sb, KERN_ERR, "access to deleted dentry");
 		return NULL;
 	}
 
fs/exfat/fatent.c +4 -4
index a855b17..dcf840 100644
@@ -305,7 +305,7 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
 	return 0;
 
 release_bhs:
-	exfat_msg(sb, KERN_ERR, "failed zeroed sect %llu\n",
+	exfat_msg(sb, KERN_ERR, "failed zeroed sect %llu",
 		(unsigned long long)blknr);
 	for (i = 0; i < n; i++)
 		bforget(bhs[i]);
@@ -325,7 +325,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
 
 	if (unlikely(total_cnt < sbi->used_clusters)) {
 		exfat_fs_error_ratelimit(sb,
-			"%s: invalid used clusters(t:%u,u:%u)\n",
+			"%s: invalid used clusters(t:%u,u:%u)",
 			__func__, total_cnt, sbi->used_clusters);
 		return -EIO;
 	}
@@ -338,7 +338,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
 	if (hint_clu == EXFAT_EOF_CLUSTER) {
 		if (sbi->clu_srch_ptr < EXFAT_FIRST_CLUSTER) {
 			exfat_msg(sb, KERN_ERR,
-				"sbi->clu_srch_ptr is invalid (%u)\n",
+				"sbi->clu_srch_ptr is invalid (%u)",
 				sbi->clu_srch_ptr);
 			sbi->clu_srch_ptr = EXFAT_FIRST_CLUSTER;
 		}
@@ -350,7 +350,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
 
 	/* check cluster validation */
 	if (hint_clu < EXFAT_FIRST_CLUSTER && hint_clu >= sbi->num_clusters) {
-		exfat_msg(sb, KERN_ERR, "hint_cluster is invalid (%u)\n",
+		exfat_msg(sb, KERN_ERR, "hint_cluster is invalid (%u)",
 			hint_clu);
 		hint_clu = EXFAT_FIRST_CLUSTER;
 		if (p_chain->flags == ALLOC_NO_FAT_CHAIN) {
fs/exfat/file.c +1 -1
index 483f68..146024 100644
@@ -235,7 +235,7 @@ void exfat_truncate(struct inode *inode, loff_t size)
 		/*
 		 * Empty start_clu != ~0 (not allocated)
 		 */
-		exfat_fs_error(sb, "tried to truncate zeroed cluster.");
+		exfat_fs_error(sb, "tried to truncate zeroed cluster");
 		goto write_size;
 	}
 
fs/exfat/inode.c +3 -3
index 068874..a84819 100644
@@ -181,7 +181,7 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
 		/* allocate a cluster */
 		if (num_to_be_allocated < 1) {
 			/* Broken FAT (i_sze > allocated FAT) */
-			exfat_fs_error(sb, "broken FAT chain.");
+			exfat_fs_error(sb, "broken FAT chain");
 			return -EIO;
 		}
 
@@ -351,7 +351,7 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,
 		err = exfat_map_new_buffer(ei, bh_result, pos);
 		if (err) {
 			exfat_fs_error(sb,
-					"requested for bmap out of range(pos : (%llu) > i_size_aligned(%llu)\n",
+					"requested for bmap out of range(pos : (%llu) > i_size_aligned(%llu)",
 					pos, ei->i_size_aligned);
 			goto unlock_ret;
 		}
@@ -428,7 +428,7 @@ static int exfat_write_end(struct file *file, struct address_space *mapping,
 
 	if (EXFAT_I(inode)->i_size_aligned < i_size_read(inode)) {
 		exfat_fs_error(inode->i_sb,
-			"invalid size(size(%llu) > aligned(%llu)\n",
+			"invalid size(size(%llu) > aligned(%llu)",
 			i_size_read(inode), EXFAT_I(inode)->i_size_aligned);
 		return -EIO;
 	}
fs/exfat/misc.c +1 -1
index 14a330..d480b5a 100644
@@ -32,7 +32,7 @@ void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
 		va_start(args, fmt);
 		vaf.fmt = fmt;
 		vaf.va = &args;
-		exfat_msg(sb, KERN_ERR, "error, %pV\n", &vaf);
+		exfat_msg(sb, KERN_ERR, "error, %pV", &vaf);
 		va_end(args);
 	}
 
fs/exfat/nls.c +2 -2
index 6d1c3a..9e07e1 100644
@@ -688,7 +688,7 @@ static int exfat_load_upcase_table(struct super_block *sb,
 		bh = sb_bread(sb, sector);
 		if (!bh) {
 			exfat_msg(sb, KERN_ERR,
-				"failed to read sector(0x%llx)\n",
+				"failed to read sector(0x%llx)",
 				(unsigned long long)sector);
 			ret = -EIO;
 			goto free_table;
@@ -723,7 +723,7 @@ static int exfat_load_upcase_table(struct super_block *sb,
 		return 0;
 
 	exfat_msg(sb, KERN_ERR,
-			"failed to load upcase table (idx : 0x%08x, chksum : 0x%08x, utbl_chksum : 0x%08x)\n",
+			"failed to load upcase table (idx : 0x%08x, chksum : 0x%08x, utbl_chksum : 0x%08x)",
 			index, checksum, utbl_checksum);
 	ret = -EINVAL;
 free_table:
fs/exfat/super.c +2 -2
index 16ed202e..3e3c606 100644
@@ -573,7 +573,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
 
 	root_inode = new_inode(sb);
 	if (!root_inode) {
-		exfat_msg(sb, KERN_ERR, "failed to allocate root inode.");
+		exfat_msg(sb, KERN_ERR, "failed to allocate root inode");
 		err = -ENOMEM;
 		goto free_table;
 	}
@@ -582,7 +582,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
 	inode_set_iversion(root_inode, 1);
 	err = exfat_read_root(root_inode);
 	if (err) {
-		exfat_msg(sb, KERN_ERR, "failed to initialize root inode.");
+		exfat_msg(sb, KERN_ERR, "failed to initialize root inode");
 		goto put_inode;
 	}
 
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines

None of these message formats should end in a newline as exfat_msg and its callers already appends messages with one.

Miscellanea:

o Remove unnecessary trailing periods from formats.

Looks good!

Thanks!

Quoted 14 lines
---
 fs/exfat/dir.c    | 4 ++--
 fs/exfat/fatent.c | 8 ++++----
 fs/exfat/file.c   | 2 +-
 fs/exfat/inode.c  | 6 +++---
 fs/exfat/misc.c   | 2 +-
 fs/exfat/nls.c    | 4 ++--
 fs/exfat/super.c  | 4 ++--
 7 files changed, 15 insertions(+), 15 deletions(-)

fs/exfat/dir.c struct exfat_dentry *exfat_get_dentry(struct · line 755

Quoted 7 lines
fs/exfat/dir.c +1 -1
@@ -750,7 +750,7 @@ struct exfat_dentry *exfat_get_dentry(struct
 super_block *sb,
 	sector_t sec;
 
 	if (p_dir->dir == DIR_DELETED) {
-		exfat_msg(sb, KERN_ERR, "abnormal access to deleted
 dentry\n");
+		exfat_msg(sb, KERN_ERR, "abnormal access to deleted

dentry");

Quoted 85 lines
fs/exfat/dir.c +0 -0
 		return NULL;
fs/exfat/dir.c +1 -1
 	}
@@ -853,7 +853,7 @@ struct exfat_entry_set_cache
 *exfat_get_dentry_set(struct super_block *sb,
 	struct buffer_head *bh;
 
 	if (p_dir->dir == DIR_DELETED) {
-		exfat_msg(sb, KERN_ERR, "access to deleted dentry\n");
+		exfat_msg(sb, KERN_ERR, "access to deleted dentry");
 		return NULL;
 	}
fs/exfat/fatent.c index a855b17..dcf840 renamed from fs/exfat/fatent.c +0 -0

100644

fs/exfat/fatent.c +1 -1
@@ -305,7 +305,7 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned
 int clu)
 	return 0;
 
 release_bhs:
-	exfat_msg(sb, KERN_ERR, "failed zeroed sect %llu\n",
+	exfat_msg(sb, KERN_ERR, "failed zeroed sect %llu",
 		(unsigned long long)blknr);
 	for (i = 0; i < n; i++)
fs/exfat/fatent.c +1 -1
 		bforget(bhs[i]);
@@ -325,7 +325,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned
 int num_alloc,
 
 	if (unlikely(total_cnt < sbi->used_clusters)) {
 		exfat_fs_error_ratelimit(sb,
-			"%s: invalid used clusters(t:%u,u:%u)\n",
+			"%s: invalid used clusters(t:%u,u:%u)",
 			__func__, total_cnt, sbi->used_clusters);
 		return -EIO;
fs/exfat/fatent.c +1 -1
 	}
@@ -338,7 +338,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned
 int num_alloc,
 	if (hint_clu == EXFAT_EOF_CLUSTER) {
 		if (sbi->clu_srch_ptr < EXFAT_FIRST_CLUSTER) {
 			exfat_msg(sb, KERN_ERR,
-				"sbi->clu_srch_ptr is invalid (%u)\n",
+				"sbi->clu_srch_ptr is invalid (%u)",
 				sbi->clu_srch_ptr);
 			sbi->clu_srch_ptr = EXFAT_FIRST_CLUSTER;
fs/exfat/fatent.c +1 -1
 		}
@@ -350,7 +350,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned
 int num_alloc,
 
 	/* check cluster validation */
 	if (hint_clu < EXFAT_FIRST_CLUSTER && hint_clu >= sbi->num_clusters)
 {
-		exfat_msg(sb, KERN_ERR, "hint_cluster is invalid (%u)\n",
+		exfat_msg(sb, KERN_ERR, "hint_cluster is invalid (%u)",
 			hint_clu);
fs/exfat/fatent.c +0 -0
 		hint_clu = EXFAT_FIRST_CLUSTER;
 		if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { diff --git

a/fs/exfat/file.c b/fs/exfat/file.c index 483f68..146024 100644

fs/exfat/file.c +1 -1
@@ -235,7 +235,7 @@ void exfat_truncate(struct inode *inode, loff_t size)
 		/*
 		 * Empty start_clu != ~0 (not allocated)
 		 */
-		exfat_fs_error(sb, "tried to truncate zeroed cluster.");
+		exfat_fs_error(sb, "tried to truncate zeroed cluster");
 		goto write_size;
 	}
 
fs/exfat/inode.c index 068874..a84819 renamed from fs/exfat/inode.c +0 -0

100644

fs/exfat/inode.c +1 -1
@@ -181,7 +181,7 @@ static int exfat_map_cluster(struct inode *inode,
 unsigned int clu_offset,
 		/* allocate a cluster */
 		if (num_to_be_allocated < 1) {
 			/* Broken FAT (i_sze > allocated FAT) */
-			exfat_fs_error(sb, "broken FAT chain.");
+			exfat_fs_error(sb, "broken FAT chain");
 			return -EIO;
 		}

fs/exfat/inode.c static int exfat_get_block(struct inode *inode, · line 355

Quoted 5 lines
fs/exfat/inode.c +0 -1
@@ -351,7 +351,7 @@ static int exfat_get_block(struct inode *inode,
 sector_t iblock,
 		err = exfat_map_new_buffer(ei, bh_result, pos);
 		if (err) {
 			exfat_fs_error(sb,
-					"requested for bmap out of range(pos

:

fs/exfat/inode.c static int exfat_get_block(struct inode *inode, · line 356

Quoted 2 lines
fs/exfat/inode.c +1 -0
 (%llu) > i_size_aligned(%llu)\n",
+					"requested for bmap out of range(pos

:

fs/exfat/misc.c void __exfat_fs_error(struct super_block *sb, int

Quoted 20 lines

(%llu) >

fs/exfat/inode.c +2 -1
+i_size_aligned(%llu)",
 					pos, ei->i_size_aligned);
 			goto unlock_ret;
 		}
@@ -428,7 +428,7 @@ static int exfat_write_end(struct file *file, struct
 address_space *mapping,
 
 	if (EXFAT_I(inode)->i_size_aligned < i_size_read(inode)) {
 		exfat_fs_error(inode->i_sb,
-			"invalid size(size(%llu) > aligned(%llu)\n",
+			"invalid size(size(%llu) > aligned(%llu)",
 			i_size_read(inode), EXFAT_I(inode)->i_size_aligned);
 		return -EIO;
fs/exfat/inode.c +0 -0
 	}
fs/exfat/misc.c index 14a330..d480b5a renamed from fs/exfat/misc.c +0 -0

100644

fs/exfat/misc.c +0 -0
@@ -32,7 +32,7 @@ void __exfat_fs_error(struct super_block *sb, int

report,

Quoted 59 lines
fs/exfat/misc.c +1 -1
 const char *fmt, ...)
 		va_start(args, fmt);
 		vaf.fmt = fmt;
 		vaf.va = &args;
-		exfat_msg(sb, KERN_ERR, "error, %pV\n", &vaf);
+		exfat_msg(sb, KERN_ERR, "error, %pV", &vaf);
 		va_end(args);
 	}
fs/exfat/nls.c +1 -1
@@ -688,7 +688,7 @@ static int exfat_load_upcase_table(struct super_block
 *sb,
 		bh = sb_bread(sb, sector);
 		if (!bh) {
 			exfat_msg(sb, KERN_ERR,
-				"failed to read sector(0x%llx)\n",
+				"failed to read sector(0x%llx)",
 				(unsigned long long)sector);
 			ret = -EIO;
fs/exfat/nls.c +2 -1
 			goto free_table;
@@ -723,7 +723,7 @@ static int exfat_load_upcase_table(struct super_block
 *sb,
 		return 0;
 
 	exfat_msg(sb, KERN_ERR,
-			"failed to load upcase table (idx : 0x%08x, chksum :
 0x%08x, utbl_chksum : 0x%08x)\n",
+			"failed to load upcase table (idx : 0x%08x, chksum :
 0x%08x,
+utbl_chksum : 0x%08x)",
 			index, checksum, utbl_checksum);
 	ret = -EINVAL;
 free_table:
fs/exfat/super.c index 16ed202e..3e3c606 renamed from fs/exfat/super.c +0 -0

100644

fs/exfat/super.c +1 -1
@@ -573,7 +573,7 @@ static int exfat_fill_super(struct super_block *sb,
 struct fs_context *fc)
 
 	root_inode = new_inode(sb);
 	if (!root_inode) {
-		exfat_msg(sb, KERN_ERR, "failed to allocate root inode.");
+		exfat_msg(sb, KERN_ERR, "failed to allocate root inode");
 		err = -ENOMEM;
 		goto free_table;
fs/exfat/super.c +1 -1
 	}
@@ -582,7 +582,7 @@ static int exfat_fill_super(struct super_block *sb,
 struct fs_context *fc)
 	inode_set_iversion(root_inode, 1);
 	err = exfat_read_root(root_inode);
 	if (err) {
-		exfat_msg(sb, KERN_ERR, "failed to initialize root inode.");
+		exfat_msg(sb, KERN_ERR, "failed to initialize root inode");
 		goto put_inode;
 	}