* [PATCH 1/1 linux-next] mtd/ftl: use swap() in copy_erase_unit()
@ 2015-06-10 16:31 ` Fabian Frederick
0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2015-06-10 16:31 UTC (permalink / raw)
To: linux-kernel
Cc: Julia Lawall, Fabian Frederick, David Woodhouse, Brian Norris, linux-mtd
Use kernel.h macro definition.
Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
drivers/mtd/ftl.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index dabf084..9fb3b0d 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;
--
2.4.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1 linux-next] mtd/ftl: use swap() in copy_erase_unit()
@ 2015-06-10 16:31 ` Fabian Frederick
0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2015-06-10 16:31 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, Julia Lawall, Brian Norris, David Woodhouse, linux-mtd
Use kernel.h macro definition.
Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
drivers/mtd/ftl.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index dabf084..9fb3b0d 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;
--
2.4.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1 linux-next] mtd/ftl: use swap() in copy_erase_unit()
2015-06-10 16:31 ` Fabian Frederick
(?)
@ 2015-12-19 0:56 ` Brian Norris
-1 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2015-12-19 0:56 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Julia Lawall, David Woodhouse, linux-mtd
Garbage collecting old patches...
On Wed, Jun 10, 2015 at 06:31:06PM +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
>
> Thanks to Julia Lawall for Coccinelle scripting support.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied to l2-mtd.git
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-19 0:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 16:31 [PATCH 1/1 linux-next] mtd/ftl: use swap() in copy_erase_unit() Fabian Frederick
2015-06-10 16:31 ` Fabian Frederick
2015-12-19 0:56 ` Brian Norris
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.