Skip to content

Commit 3fb803c

Browse files
Scha77entytso
authored andcommitted
ext4: Use %pe to print PTR_ERR()
Replace %ld with %pe and PTR_ERR(path) with path pointer. The %pe specifier automatically converts error pointers to human-readable error names instead of raw error codes. These changes were found by coccicheck. Signed-off-by: Abdellah Ouhbi <abdououhbi1@gmail.com> Link: https://patch.msgid.link/20260424154307.169881-1-abdououhbi1@gmail.com Link: https://patch.msgid.link/20260424155508.186235-1-abdououhbi1@gmail.com Link: https://patch.msgid.link/20260424152245.142308-1-abdououhbi1@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent d99748e commit 3fb803c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

fs/ext4/extents.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,8 +3268,8 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle,
32683268
*/
32693269
path = ext4_find_extent(inode, ee_block, NULL, flags | EXT4_EX_NOFAIL);
32703270
if (IS_ERR(path)) {
3271-
EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %ld",
3272-
split, PTR_ERR(path));
3271+
EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %pe",
3272+
split, path);
32733273
goto out_path;
32743274
}
32753275

fs/ext4/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
145145
if (IS_ERR(bh)) {
146146
__ext4_warning(inode->i_sb, func, line,
147147
"inode #%llu: lblock %lu: comm %s: "
148-
"error %ld reading directory block",
148+
"error %pe reading directory block",
149149
inode->i_ino, (unsigned long)block,
150-
current->comm, PTR_ERR(bh));
150+
current->comm, bh);
151151

152152
return bh;
153153
}

fs/ext4/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5977,8 +5977,8 @@ static struct file *ext4_get_journal_blkdev(struct super_block *sb,
59775977
sb, &fs_holder_ops);
59785978
if (IS_ERR(bdev_file)) {
59795979
ext4_msg(sb, KERN_ERR,
5980-
"failed to open journal device unknown-block(%u,%u) %ld",
5981-
MAJOR(j_dev), MINOR(j_dev), PTR_ERR(bdev_file));
5980+
"failed to open journal device unknown-block(%u,%u) %pe",
5981+
MAJOR(j_dev), MINOR(j_dev), bdev_file);
59825982
return bdev_file;
59835983
}
59845984

0 commit comments

Comments
 (0)