From patchwork Thu Oct 26 12:57:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10028101 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 28EFE6022E for ; Thu, 26 Oct 2017 12:58:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AED528DCD for ; Thu, 26 Oct 2017 12:58:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FC3B28DF3; Thu, 26 Oct 2017 12:58:51 +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 0455328DEB for ; Thu, 26 Oct 2017 12:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932396AbdJZM6t (ORCPT ); Thu, 26 Oct 2017 08:58:49 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:51122 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932338AbdJZM6s (ORCPT ); Thu, 26 Oct 2017 08:58:48 -0400 Received: by mail-lf0-f67.google.com with SMTP id a132so3644042lfa.7 for ; Thu, 26 Oct 2017 05:58:47 -0700 (PDT) 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=+x+40vAPZsGHjwmyiP841T7M9im2Ff9gitIr5cXMwTU=; b=BQi+CyuduQmOeOp6+fVsIg5aL51HKfpiIFle/c2MW4HZsWC+BT3CzLlD1u/87EeVzJ zv7WxFQMtgzOLcZ4sKeu6/gqAZ3upoBPczk8xW55WVHhI9sM8ckNlx00pr5352YgvOe4 MCPZNzO5g5SCz4Fyv4TjdunpQQXvQwhw9yViY= 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=+x+40vAPZsGHjwmyiP841T7M9im2Ff9gitIr5cXMwTU=; b=Eonj4+ydieRLgAOf/ZVEmu+g3MpjId7NlrcQbBdYACW82qlubpuYnw+VQHU+Bw4u5W 2q6zLVhZwbyjbLuZK9keC3MclecSuvrWIVjJ8Pk496CT9am1JltCt+D947OVzGKsP2Rr 68NEmblCrGvMd9jSAS/PxCdpGYbS2wZJa9RTFW7KCqkVeQ+1BqPugENrxU261QR1uFyS oPBcCtbfHEVH4fAtW79Owz8pwVjKlHPXcNn40QOoX8NJxipVsdGkF+awdu1sxZFaz6eo hJLtmV9HbuZpXtEterXavKiRiKYGe7H8oNHPDg8Xu3Jn8xNW96j6eK1fnuhxRDuelLEj TxKA== X-Gm-Message-State: AMCzsaU62pkXtUiCMZuloE2Jmkm62ubmy0B0zS1bCyRKKMW+ZO/MEbCq 9rjqck5Shm3PhQyoJLCKAhi0xaXhbZ8= X-Google-Smtp-Source: ABhQp+SHPuezCg3Cbp1YdcVtqU0fyq0pTvAfF25FWYY1HEVZxFRTrGevbTxm++ZRQf/kEnytSK/R2w== X-Received: by 10.25.78.141 with SMTP id u13mr7139052lfk.156.1509022726683; Thu, 26 Oct 2017 05:58:46 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 34sm1165600lfr.25.2017.10.26.05.58.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Oct 2017 05:58:45 -0700 (PDT) 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 v4] mmc: queue: simplify queue logic Date: Thu, 26 Oct 2017 14:57:52 +0200 Message-Id: <20171026125757.10200-8-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171026125757.10200-1-linus.walleij@linaro.org> References: <20171026125757.10200-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 --- 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;