LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] mmc: queue: use swap() in mmc_queue_thread()
@ 2015-06-10 16:30 Fabian Frederick
  2015-06-15  9:54 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-06-10 16:30 UTC (permalink / raw
  To: linux-kernel; +Cc: Julia Lawall, Fabian Frederick, Ulf Hansson, linux-mmc

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/mmc/card/queue.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 8efa368..d34e09b 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -56,7 +56,6 @@ static int mmc_queue_thread(void *d)
 	down(&mq->thread_sem);
 	do {
 		struct request *req = NULL;
-		struct mmc_queue_req *tmp;
 		unsigned int cmd_flags = 0;
 
 		spin_lock_irq(q->queue_lock);
@@ -86,9 +85,7 @@ static int mmc_queue_thread(void *d)
 
 			mq->mqrq_prev->brq.mrq.data = NULL;
 			mq->mqrq_prev->req = NULL;
-			tmp = mq->mqrq_prev;
-			mq->mqrq_prev = mq->mqrq_cur;
-			mq->mqrq_cur = tmp;
+			swap(mq->mqrq_prev, mq->mqrq_cur);
 		} else {
 			if (kthread_should_stop()) {
 				set_current_state(TASK_RUNNING);
-- 
2.4.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1 linux-next] mmc: queue: use swap() in mmc_queue_thread()
  2015-06-10 16:30 [PATCH 1/1 linux-next] mmc: queue: use swap() in mmc_queue_thread() Fabian Frederick
@ 2015-06-15  9:54 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-06-15  9:54 UTC (permalink / raw
  To: Fabian Frederick; +Cc: linux-kernel@vger.kernel.org, Julia Lawall, linux-mmc

On 10 June 2015 at 18:30, Fabian Frederick <fabf@skynet.be> wrote:
> Use kernel.h macro definition.
>
> Thanks to Julia Lawall for Coccinelle scripting support.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Thanks, applied.

Kind regards
Uffe

> ---
>  drivers/mmc/card/queue.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 8efa368..d34e09b 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -56,7 +56,6 @@ static int mmc_queue_thread(void *d)
>         down(&mq->thread_sem);
>         do {
>                 struct request *req = NULL;
> -               struct mmc_queue_req *tmp;
>                 unsigned int cmd_flags = 0;
>
>                 spin_lock_irq(q->queue_lock);
> @@ -86,9 +85,7 @@ static int mmc_queue_thread(void *d)
>
>                         mq->mqrq_prev->brq.mrq.data = NULL;
>                         mq->mqrq_prev->req = NULL;
> -                       tmp = mq->mqrq_prev;
> -                       mq->mqrq_prev = mq->mqrq_cur;
> -                       mq->mqrq_cur = tmp;
> +                       swap(mq->mqrq_prev, mq->mqrq_cur);
>                 } else {
>                         if (kthread_should_stop()) {
>                                 set_current_state(TASK_RUNNING);
> --
> 2.4.2
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-15  9:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 16:30 [PATCH 1/1 linux-next] mmc: queue: use swap() in mmc_queue_thread() Fabian Frederick
2015-06-15  9:54 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).