ocfs2: remove some redundant casting
authorGeorge Spelvin <linux@horizon.com>
Wed, 4 Jun 2014 23:06:08 +0000 (16:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:53:54 +0000 (16:53 -0700)
There are two standard techniques for dereferencing structures pointed
to by void *: cast to the right type each time they're used, or assign
to local variables of the right type.

But there's no need to do *both*.

Signed-off-by: George Spelvin <linux@horizon.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/refcounttree.c

index 6ba4bcb..714e53b 100644 (file)
@@ -1408,10 +1408,9 @@ static void swap_refcount_rec(void *a, void *b, int size)
 {
        struct ocfs2_refcount_rec *l = a, *r = b, tmp;
 
-       tmp = *(struct ocfs2_refcount_rec *)l;
-       *(struct ocfs2_refcount_rec *)l =
-                       *(struct ocfs2_refcount_rec *)r;
-       *(struct ocfs2_refcount_rec *)r = tmp;
+       tmp = *l;
+       *l = *r;
+       *r = tmp;
 }
 
 /*