Skip to content

Commit

Permalink
ceph: remove unnecessary cast in kfree()
Browse files Browse the repository at this point in the history
Remove unnecassary casts in the argument to kfree.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Xu Wang authored and Ilya Dryomov committed Aug 3, 2020
1 parent 042f649 commit c00e452
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit c00e452

Please sign in to comment.