]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ocfs2: remove some redundant casting
authorGeorge Spelvin <linux@horizon.com>
Wed, 14 May 2014 00:01:25 +0000 (10:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 May 2014 00:01:25 +0000 (10:01 +1000)
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>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/refcounttree.c

index 6ba4bcbc479601bcad6a98ba7a73ccc80dc40710..714e53b9cc6606a178ee2c8f0121fd12156c0539 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;
 }
 
 /*