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: 10052753 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 2FEA36035D 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 1A08B2B242 for ; Fri, 10 Nov 2017 10:02:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E1E32B23E; 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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 B9F2C2B23E for ; Fri, 10 Nov 2017 10:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752405AbdKJKCI (ORCPT ); Fri, 10 Nov 2017 05:02:08 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:56190 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbdKJKCF (ORCPT ); Fri, 10 Nov 2017 05:02:05 -0500 Received: by mail-lf0-f65.google.com with SMTP id e143so10426045lfg.12 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=OvjbN3FR756z2gMga79W/aSAzudpuq5Z7KrL9BbCXu4TgDNrJX5og9iihNd6rESEFx 1H2egnCkLh8gkMCNBDO0o7mp3tzyEE9FyAAXnUGsFmMTku3vtO6LX98L5+SknDVpq11x G24XfS/SR8+JPqfBWEPxO0YMsl3cn0l5ykrq3rRr28b6oDnWf26kQhezmbETzi8F2V+m eptL0e4iccjykIPMQ9B3eN7Q6L7bCmhcs2QnalmCNJarOGJ4dQC6DuHCtn64G/eocFPl wGnV211B8Er5Gcw5qYk418BQwmwYvjoT7S/dCR0u02nAFNwFTsxTgiigCnZBTA0AOrU5 JiTQ== X-Gm-Message-State: AJaThX7DytsE2OIkoPejD4q/Hxm4cVw53ubrlnEgoPAthXNITlRtQKGw LdU+B0318XsRq2vLuf/lXbDf+w== 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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@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;