ext4: use swap() in memswap()
authorFabian Frederick <fabf@skynet.be>
Sat, 13 Jun 2015 03:46:33 +0000 (23:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 13 Jun 2015 03:46:33 +0000 (23:46 -0400)
Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ioctl.c

index 7ce85824211b924ff6f2eebd2786c5b569371bea..cb8451246b30ae72c9787fe0e7326ac9c77b7b29 100644 (file)
 static void memswap(void *a, void *b, size_t len)
 {
        unsigned char *ap, *bp;
-       unsigned char tmp;
 
        ap = (unsigned char *)a;
        bp = (unsigned char *)b;
        while (len-- > 0) {
-               tmp = *ap;
-               *ap = *bp;
-               *bp = tmp;
+               swap(*ap, *bp);
                ap++;
                bp++;
        }