Skip to contentSkip to conversation

ext4: Use %pe to print PTR_ERR() in extents.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 extents.c

Fix coccicheck warning
./extents.c:3272:12-19: WARNING: Consider using %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.

---
 fs/ext4/extents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/extents.c +2 -2
index 125f628e738a..91c97af64b31 100644
@@ -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;
 	}
 
Signature · 1 line
2.51.0