From patchwork Thu Feb 9 15:33:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9564933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6A3760216 for ; Thu, 9 Feb 2017 15:36:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 956BA28535 for ; Thu, 9 Feb 2017 15:36:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 886402853C; Thu, 9 Feb 2017 15:36:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C6BF28535 for ; Thu, 9 Feb 2017 15:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752685AbdBIPgQ (ORCPT ); Thu, 9 Feb 2017 10:36:16 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:35040 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753923AbdBIPgI (ORCPT ); Thu, 9 Feb 2017 10:36:08 -0500 Received: by mail-lf0-f47.google.com with SMTP id n124so4533148lfd.2 for ; Thu, 09 Feb 2017 07:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5cBy3a2SdO/KkSMLpJs+N9esxzJ6Dg/TfJOs50r40CA=; b=IuKPuttp3UNMkRzwU7SYHJLK0VQwfm1ur0OvS2ibIfNFZR/ryVarWzlNRV5BKwHpMg R/droVIEDUIK/AmrYJn7sa3vtY3zuNSeHLPSmdbXmVT6XUm59LZwW/81qwRqGxEsMywi lEBEgB3ZX5En8fqD0Y3icZcHRPEuC3fqy10ik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5cBy3a2SdO/KkSMLpJs+N9esxzJ6Dg/TfJOs50r40CA=; b=gWi/ioV9Bh2FanexaD7k46/V1KXfzgjX8a1XN19eD2rAqFvU4ox0fq0/iCDqDiGLCs 7KDoUVCCGaBDHRxeSqlaMDDWBAzFpDG7y4HveskVp7TM75GoM4kTEwtQaVBTVTbAJBRJ Ue9/M2CV4S9Nixg6/Tvs2kJsqzBNSM34GEMI2VMHiklisK0h4n09lrJbPtN+mY2h5uJg oWTtoYkWuhzLKQGnj0QeG1b8Na5AeOVTg8ZQbzF/eQW2Jq2Z8U3cpCbkTo57mJoki+96 ggM7Y9QktTOslYTMOY3ETxnb5v1o6NfAis6s3oJFRC90JF5x+EMBrY80zHO7Fd+tjw1V 2zDA== X-Gm-Message-State: AMke39kVucumxAh1Ak8UOUdTH1UwT4n14SxPb+RsonooypaToqE8XBC99O+A80SMlntZB1cc X-Received: by 10.25.104.20 with SMTP id d20mr1378164lfc.108.1486654516308; Thu, 09 Feb 2017 07:35:16 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e86sm3670614lji.32.2017.02.09.07.35.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 07:35:15 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Paolo Valente Cc: Chunyan Zhang , Baolin Wang , linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Linus Walleij Subject: [PATCH 10/16] mmc: queue: simplify queue logic Date: Thu, 9 Feb 2017 16:33:57 +0100 Message-Id: <20170209153403.9730-11-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170209153403.9730-1-linus.walleij@linaro.org> References: <20170209153403.9730-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The if() statment checking if there is no current or previous request is now just looking ahead at something that will be concluded a few lines below. Simplify the logic by moving the assignment of .asleep. Signed-off-by: Linus Walleij Reviewed-by: Bartlomiej Zolnierkiewicz --- drivers/mmc/core/queue.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index a845fe8d4fd1..bc116709c806 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -64,14 +64,6 @@ static int mmc_queue_thread(void *d) set_current_state(TASK_INTERRUPTIBLE); req = blk_fetch_request(q); mq->asleep = false; - if (!req) { - /* - * Dispatch queue is empty so set flags for - * mmc_request_fn() to wake us up. - */ - if (!mq->mqrq_prev->req) - mq->asleep = true; - } mq->mqrq_cur->req = req; spin_unlock_irq(q->queue_lock); @@ -95,6 +87,7 @@ static int mmc_queue_thread(void *d) mq->mqrq_prev->req = NULL; swap(mq->mqrq_prev, mq->mqrq_cur); } else { + mq->asleep = true; if (kthread_should_stop()) { set_current_state(TASK_RUNNING); break;