From patchwork Fri Nov 10 10:01:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10052755 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 65A4860631 for ; Fri, 10 Nov 2017 10:02:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 519E32B23E for ; Fri, 10 Nov 2017 10:02:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4687E2B23F; Fri, 10 Nov 2017 10:02:10 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 EF44F2B24A for ; Fri, 10 Nov 2017 10:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbdKJKCI (ORCPT ); Fri, 10 Nov 2017 05:02:08 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:54895 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbdKJKCG (ORCPT ); Fri, 10 Nov 2017 05:02:06 -0500 Received: by mail-lf0-f68.google.com with SMTP id a2so10424191lfh.11 for ; Fri, 10 Nov 2017 02:02:05 -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=QcPT8Y7u6xwrClUs8PB51R4/qwTf7FbR7vzBwitYMMw=; b=BQZcOb6LklCKwaXnC1w+VkpK9hXBNGVDaRBsjNHzettBf7OxbFiak85K7ZfMWg7OS6 P+CjTEpM0t1OpQXIHdn+s6upfh3q7UqGsdty5RmMQgMKJ7utveSFYlX0nQRUKlelCsat K4pMQ6p/chcnJuT67quqQ/8yTVjOYuacx9PkM= 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=QcPT8Y7u6xwrClUs8PB51R4/qwTf7FbR7vzBwitYMMw=; b=axHgIbfYYA3k2syAsnzs+azxfJT69APY0V2Ave5rLKzRCO5Ssv3UaICiaxHTqsYLbr Av1AmXtSejiEqi3bO1JC0qSuPHjCeeko/6RrDKmIALL+ev7l/mI3PCrwy1k2XWsRw9Kw azTRdDg/rsE6UtbhIqzirZ204D+/R4ULBIfFqRxS1smLkuSBmDZBjiGuWARQQ/IwHBpc irgmqEyOC+x0EcinAGK2xQ8QrAgH54oFUBXf++Xot2ZHP80jT5O/3TOsE3M/nMnFC9Np T1pfs+6cnUt28gztDsp5SVZUVHhQ6xkGeLDWvv99xmujl5cdziFW1U7Vrzoh8+kTCO3o 2jxw== X-Gm-Message-State: AJaThX7qFIoz7WoFji/+YSG1UmpR3P6Kkk5GJcqJIp3iGpZzGRY6fQd0 JiRQ9gT2DoTJ6MILxxHkN1UrH8XM/qA= X-Google-Smtp-Source: AGs4zMbNNQgAJ3uMrcrMuGTiSMoq2mLnuGjg7O324nenk/PH8q1DoKWfHX/6vnN3vEsU2Sg4cE96rQ== X-Received: by 10.25.121.15 with SMTP id u15mr1031150lfc.9.1510308124362; Fri, 10 Nov 2017 02:02:04 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n36sm310843lfi.78.2017.11.10.02.02.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Nov 2017 02:02:03 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Bartlomiej Zolnierkiewicz , Paolo Valente , Avri Altman , Adrian Hunter , Linus Walleij Subject: [PATCH 07/12 v5] mmc: queue: simplify queue logic Date: Fri, 10 Nov 2017 11:01:38 +0100 Message-Id: <20171110100143.12256-8-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171110100143.12256-1-linus.walleij@linaro.org> References: <20171110100143.12256-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 --- ChangeLog v1->v5: - Rebasing on the "next" branch in the MMC tree. --- 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 2c232ba4e594..023bbddc1a0b 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -53,14 +53,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->qcnt) - mq->asleep = true; - } spin_unlock_irq(q->queue_lock); if (req || mq->qcnt) { @@ -68,6 +60,7 @@ static int mmc_queue_thread(void *d) mmc_blk_issue_rq(mq, req); cond_resched(); } else { + mq->asleep = true; if (kthread_should_stop()) { set_current_state(TASK_RUNNING); break;