diff options
author | Fabian Frederick <fabf@skynet.be> | 2015-06-10 19:31:06 +0300 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-12-19 03:56:07 +0300 |
commit | 6166a76f5ef7619faa28b38d7817e5fe0e509942 (patch) | |
tree | 2242f5e68ae7baa79d0f4e734bcdac63ef9fc99a /drivers/mtd/ftl.c | |
parent | fdd9d27c8a47ea81daeaddfe6c0156ae7cf68096 (diff) | |
download | linux-6166a76f5ef7619faa28b38d7817e5fe0e509942.tar.xz |
mtd: ftl: use swap() in copy_erase_unit()
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>
Diffstat (limited to 'drivers/mtd/ftl.c')
-rw-r--r-- | drivers/mtd/ftl.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index dabf08450d0b..9fb3b0dcdac2 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -571,12 +571,8 @@ static int copy_erase_unit(partition_t *part, uint16_t srcunit, /* Update the maps and usage stats*/ - i = xfer->EraseCount; - xfer->EraseCount = eun->EraseCount; - eun->EraseCount = i; - i = xfer->Offset; - xfer->Offset = eun->Offset; - eun->Offset = i; + swap(xfer->EraseCount, eun->EraseCount); + swap(xfer->Offset, eun->Offset); part->FreeTotal -= eun->Free; part->FreeTotal += free; eun->Free = free; |