aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/queue.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-02-01 07:47:56 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2017-02-13 07:21:00 -0500
commit9491be5ff06ff08d61e6a8d767382ea0037a6f38 (patch)
treed759768390b4541401cd683bdfc12c04f02a7df0 /drivers/mmc/core/queue.c
parent74f5ba357c7cd63c664e65fb7a116dbc0538a2ec (diff)
mmc: queue: turn queue flags into bools
Instead of masking and setting two bits in the "flags" field for the mmc_queue, just use two bools named "suspended" and "new_request". The masking and setting would likely have race conditions anyways, it is better to use a simple member like this. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/queue.c')
-rw-r--r--drivers/mmc/core/queue.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 611f5c6d1950..5cb369c2664b 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -86,8 +86,8 @@ static int mmc_queue_thread(void *d)
86 set_current_state(TASK_RUNNING); 86 set_current_state(TASK_RUNNING);
87 mmc_blk_issue_rq(mq, req); 87 mmc_blk_issue_rq(mq, req);
88 cond_resched(); 88 cond_resched();
89 if (mq->flags & MMC_QUEUE_NEW_REQUEST) { 89 if (mq->new_request) {
90 mq->flags &= ~MMC_QUEUE_NEW_REQUEST; 90 mq->new_request = false;
91 continue; /* fetch again */ 91 continue; /* fetch again */
92 } 92 }
93 93
@@ -401,8 +401,8 @@ void mmc_queue_suspend(struct mmc_queue *mq)
401 struct request_queue *q = mq->queue; 401 struct request_queue *q = mq->queue;
402 unsigned long flags; 402 unsigned long flags;
403 403
404 if (!(mq->flags & MMC_QUEUE_SUSPENDED)) { 404 if (!mq->suspended) {
405 mq->flags |= MMC_QUEUE_SUSPENDED; 405 mq->suspended |= true;
406 406
407 spin_lock_irqsave(q->queue_lock, flags); 407 spin_lock_irqsave(q->queue_lock, flags);
408 blk_stop_queue(q); 408 blk_stop_queue(q);
@@ -421,8 +421,8 @@ void mmc_queue_resume(struct mmc_queue *mq)
421 struct request_queue *q = mq->queue; 421 struct request_queue *q = mq->queue;
422 unsigned long flags; 422 unsigned long flags;
423 423
424 if (mq->flags & MMC_QUEUE_SUSPENDED) { 424 if (mq->suspended) {
425 mq->flags &= ~MMC_QUEUE_SUSPENDED; 425 mq->suspended = false;
426 426
427 up(&mq->thread_sem); 427 up(&mq->thread_sem);
428 428