Skip to contentSkip to conversation

btrfs: backref.c: Use ERR_CAST() to return error code

PATCH In review Misono Tomohiro 3 participants 3 messages Jul 26, 2018 – Aug 1, 2018 1 message not in the archive Btrfs file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 btrfs: backref.c: Use ERR_CAST() to return error code

Use ERR_CAST() instead of void * to make meaning clear.

---
 fs/btrfs/backref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/backref.c +1 -1
index 7ce0b5f9e99e..9f231bbccb1e 100644
@@ -2231,7 +2231,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root,
 
 	fspath = init_data_container(total_bytes);
 	if (IS_ERR(fspath))
-		return (void *)fspath;
+		return ERR_CAST(fspath);
 
 	ifp = kmalloc(sizeof(*ifp), GFP_KERNEL);
 	if (!ifp) {
Signature · 1 line
2.14.4
Reviewed-by on v1 1/1
#2 lore raw
Quoted 3 lines · Misono Tomohiro

Use ERR_CAST() instead of void * to make meaning clear.

Quoted 18 lines
---
 fs/btrfs/backref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/backref.c +1 -1
index 7ce0b5f9e99e..9f231bbccb1e 100644
@@ -2231,7 +2231,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root,
 
 	fspath = init_data_container(total_bytes);
 	if (IS_ERR(fspath))
-		return (void *)fspath;
+		return ERR_CAST(fspath);
 
 	ifp = kmalloc(sizeof(*ifp), GFP_KERNEL);
 	if (!ifp) {