mtd: cfi_cmdset_0002: use swap() in cfi_cmdset_0002()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:28 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=fdd9d27c8a47ea81daeaddfe6c0156ae7cf68096
Commit:     fdd9d27c8a47ea81daeaddfe6c0156ae7cf68096
Parent:     80e1ca692107b0bc5b088fd9c4a20726fb1a66a2
Author:     Fabian Frederick <fabf at skynet.be>
AuthorDate: Wed Jun 10 18:31:32 2015 +0200
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Dec 18 16:55:28 2015 -0800

    mtd: cfi_cmdset_0002: use swap() in cfi_cmdset_0002()
    
    Use kernel.h macro definition.
    
    Thanks to Julia Lawall for Coccinelle scripting support.
    
    Signed-off-by: Fabian Frederick <fabf at skynet.be>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/chips/cfi_cmdset_0002.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index c3624eb..9dca881 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -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 */



More information about the linux-mtd-cvs mailing list