Skip to contentSkip to conversation

fs: ceph: Remove unnecessary cast in kfree()

PATCH Applied Xu Wang 2 participants 2 messages Jul 8, 2020 Ceph client

lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 fs: ceph: Remove unnecessary cast in kfree()

Remove unnecassary casts in the argument to kfree.

---
 fs/ceph/xattr.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/ceph/xattr.c +6 -6
index 71ee34d160c3..3a733ac33d9b 100644
@@ -497,10 +497,10 @@ static int __set_xattr(struct ceph_inode_info *ci,
 		kfree(*newxattr);
 		*newxattr = NULL;
 		if (xattr->should_free_val)
-			kfree((void *)xattr->val);
+			kfree(xattr->val);
 
 		if (update_xattr) {
-			kfree((void *)name);
+			kfree(name);
 			name = xattr->name;
 		}
 		ci->i_xattrs.names_size -= xattr->name_len;
@@ -566,9 +566,9 @@ static void __free_xattr(struct ceph_inode_xattr *xattr)
 	BUG_ON(!xattr);
 
 	if (xattr->should_free_name)
-		kfree((void *)xattr->name);
+		kfree(xattr->name);
 	if (xattr->should_free_val)
-		kfree((void *)xattr->val);
+		kfree(xattr->val);
 
 	kfree(xattr);
 }
@@ -582,9 +582,9 @@ static int __remove_xattr(struct ceph_inode_info *ci,
 	rb_erase(&xattr->node, &ci->i_xattrs.index);
 
 	if (xattr->should_free_name)
-		kfree((void *)xattr->name);
+		kfree(xattr->name);
 	if (xattr->should_free_val)
-		kfree((void *)xattr->val);
+		kfree(xattr->val);
 
 	ci->i_xattrs.names_size -= xattr->name_len;
 	ci->i_xattrs.vals_size -= xattr->val_len;
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 39 lines · Xu Wang

Remove unnecassary casts in the argument to kfree.

---
 fs/ceph/xattr.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/ceph/xattr.c +4 -4
index 71ee34d160c3..3a733ac33d9b 100644
@@ -497,10 +497,10 @@ static int __set_xattr(struct ceph_inode_info *ci,
                kfree(*newxattr);
                *newxattr = NULL;
                if (xattr->should_free_val)
-                       kfree((void *)xattr->val);
+                       kfree(xattr->val);
 
                if (update_xattr) {
-                       kfree((void *)name);
+                       kfree(name);
                        name = xattr->name;
                }
                ci->i_xattrs.names_size -= xattr->name_len;
@@ -566,9 +566,9 @@ static void __free_xattr(struct ceph_inode_xattr *xattr)
        BUG_ON(!xattr);
 
        if (xattr->should_free_name)
-               kfree((void *)xattr->name);
+               kfree(xattr->name);
        if (xattr->should_free_val)
-               kfree((void *)xattr->val);
+               kfree(xattr->val);
 
        kfree(xattr);
 }
@@ -582,9 +582,9 @@ static int __remove_xattr(struct ceph_inode_info *ci,
        rb_erase(&xattr->node, &ci->i_xattrs.index);

fs/ceph/xattr.c static int __remove_xattr(struct ceph_inode_info *ci, · line 590

Quoted 10 lines
fs/ceph/xattr.c +2 -2
 
        if (xattr->should_free_name)
-               kfree((void *)xattr->name);
+               kfree(xattr->name);
        if (xattr->should_free_val)
-               kfree((void *)xattr->val);
+               kfree(xattr->val);
 
        ci->i_xattrs.names_size -= xattr->name_len;
        ci->i_xattrs.vals_size -= xattr->val_len;

Applied.

Thanks,

Ilya