]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: Use %pe to print PTR_ERR()
authorAbdellah Ouhbi <abdououhbi1@gmail.com>
Fri, 24 Apr 2026 15:43:07 +0000 (16:43 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 1 Jun 2026 12:25:38 +0000 (08:25 -0400)
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>
fs/ext4/extents.c
fs/ext4/namei.c
fs/ext4/super.c

index 125f628e738ab19049aed199f6ea7cf1a7c3f424..91c97af64b31778edd70f46362b0722e66584ff3 100644 (file)
@@ -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;
        }
 
index 4a47fbd8dd30ceb0f8635827a049208a05a1f472..c0cabf1720200c20624f35868dcfaed88d2ed55b 100644 (file)
@@ -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;
        }
index 6a77db4d3124ec89eefec768e1a515caac3055fa..4b69e087973112cfc706b92a303d4699c36d27f8 100644 (file)
@@ -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;
        }