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: 118521 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp7722608qgn; Fri, 10 Nov 2017 02:02:10 -0800 (PST) X-Google-Smtp-Source: ABhQp+QplNo2AfcKpzC4c26r41h39Zxt8d3+KJ8cNOzk6MOie2qjiLAypON3aKp77HDNtZNrLWhZ X-Received: by 10.159.207.149 with SMTP id z21mr3786530plo.164.1510308130211; Fri, 10 Nov 2017 02:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510308130; cv=none; d=google.com; s=arc-20160816; b=w7baRaplVtgyaCjT2LIaraXEWMgRHMJVA7y9vNQQa7xt2JobBnUsRqSDh8n68XKHKF mytLNeMvxUDhiwLEu5E/1QwcszCSgDWJaexInRTKqcA/eGyGG7x+jW3OuP+SIg+mCEUE 0U38aXZara7svIzIHBNrVRKCgi4v5Z5pzW6djzk6By5B7+8C2AyYamwz5LhfRhFCZHG2 O7+rGVHeUxz9wXf4UzLlwH63qeLdBK4biIopvWsBauD0dqKqIoJB8+1tNsgJHqFHliDw PBxX5bmA9i4jYqYLVRQLw+BNSSmLVe/pTiX3GQJgEiNUIOHWSgkTFB2XBFVhMmwEm/FB LxzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=W/o0Jj20me84xiVc6Ux69IQ+vQUO2/Ht+DPv08HAqKU=; b=vaoD1bNVyuz3GTXqXx9rekoHTmDq1RVVxXnzhchZhIMi883qqzeZwGGYWcCuelbi3n oxuzy8A/Y3iUcDPeIEOXrhH9JeWQE08En+UXj1VXaDl0l0B2/1kdHjT4M7A2/ky7bHXy 18h3OMe516pWVlErvxQ9kaqhyI0kL17N9mVDeq7ojyfeyVPSM/yGvbJLhbt9zYizPpOB JmtwnFC1GAuWDyRAScGMFrAhyKDiC+O7Ccef2nl9uU4pARuVlMJ2uiK+3m2oFvKC/QjN TGtRtStOgHmXoWmWxb8SZwVIeUAGQIdZYd0AeIUSsyASCSoWpka6c/cX52ULqBFbgJIs AatA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BQZcOb6L; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si8801659plh.282.2017.11.10.02.02.10; Fri, 10 Nov 2017 02:02:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BQZcOb6L; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbdKJKCI (ORCPT + 6 others); 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-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 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(-) -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;