mtd: cfi_cmdset_0002: use swap() in cfi_cmdset_0002()
authorFabian Frederick <fabf@skynet.be>
Wed, 10 Jun 2015 16:31:32 +0000 (18:31 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Sat, 19 Dec 2015 00:55:28 +0000 (16:55 -0800)
Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/chips/cfi_cmdset_0002.c

index c3624eb571d16f0067acc8137e8654f1bf829a37..9dca881bb3780e9c2325318ef56f69288c4da076 100644 (file)
@@ -615,11 +615,9 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 
                                for (i=0; i<cfi->cfiq->NumEraseRegions / 2; i++) {
                                        int j = (cfi->cfiq->NumEraseRegions-1)-i;
-                                       __u32 swap;
 
-                                       swap = cfi->cfiq->EraseRegionInfo[i];
-                                       cfi->cfiq->EraseRegionInfo[i] = cfi->cfiq->EraseRegionInfo[j];
-                                       cfi->cfiq->EraseRegionInfo[j] = swap;
+                                       swap(cfi->cfiq->EraseRegionInfo[i],
+                                            cfi->cfiq->EraseRegionInfo[j]);
                                }
                        }
                        /* Set the default CFI lock/unlock addresses */