From: Abdellah Ouhbi Date: Fri, 24 Apr 2026 15:43:07 +0000 (+0100) Subject: ext4: Use %pe to print PTR_ERR() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb803cdfbb1a2c31a77b1c0e6b6e2022f29af97;p=thirdparty%2Flinux.git 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 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 --- diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 125f628e738ab..91c97af64b317 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3268,8 +3268,8 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle, */ path = ext4_find_extent(inode, ee_block, NULL, flags | EXT4_EX_NOFAIL); if (IS_ERR(path)) { - EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %ld", - split, PTR_ERR(path)); + EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %pe", + split, path); goto out_path; } diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 4a47fbd8dd30c..c0cabf1720200 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -145,9 +145,9 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode, if (IS_ERR(bh)) { __ext4_warning(inode->i_sb, func, line, "inode #%llu: lblock %lu: comm %s: " - "error %ld reading directory block", + "error %pe reading directory block", inode->i_ino, (unsigned long)block, - current->comm, PTR_ERR(bh)); + current->comm, bh); return bh; } diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 6a77db4d3124e..4b69e08797311 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -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; }