Skip to contentSkip to conversation

ext4: Use %pe to print PTR_ERR() in super.c

PATCH New Abdellah Ouhbi 1 participant 1 message Apr 24 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: Use %pe to print PTR_ERR() in super.c

Fix coccicheck warning
./super.c:5981:32-39: WARNING: Consider using %pe to print PTR_ERR()

Replace %ld with %pe and PTR_ERR(bdev_file) with bdev_file pointer. The %pe specifier automatically converts error pointers to human-readable error names instead of raw error codes.

---
 fs/ext4/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/super.c +2 -2
index 6a77db4d3124..4b69e0879731 100644
@@ -5977,8 +5977,8 @@ static struct file *ext4_get_journal_blkdev(struct super_block *sb,
 		sb, &fs_holder_ops);
 	if (IS_ERR(bdev_file)) {
 		ext4_msg(sb, KERN_ERR,
-			 "failed to open journal device unknown-block(%u,%u) %ld",
-			 MAJOR(j_dev), MINOR(j_dev), PTR_ERR(bdev_file));
+			 "failed to open journal device unknown-block(%u,%u) %pe",
+			 MAJOR(j_dev), MINOR(j_dev), bdev_file);
 		return bdev_file;
 	}
 
Signature · 1 line
2.51.0