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: 117228 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp733606qgn; Thu, 26 Oct 2017 05:58:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+STRT6CoETJLaAoIXeffYbjWYu9E6Bv1EeBfSt6LJC4ocTr+ePDQqa7gj1kZqfYUa6VnIww X-Received: by 10.84.198.131 with SMTP id p3mr4363437pld.245.1509022730194; Thu, 26 Oct 2017 05:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509022730; cv=none; d=google.com; s=arc-20160816; b=I5hLwVJ4xp9loSdkocR0GBw7pmun11TJk+yqxaGw6Govjqlr2q+KRi9UinH2XJLW7w B6glxHBe3DwM77fu0G0c0ptGGmp5ddamnjzgqVNf1iWlQz6kj46aqnuKYMRz1gzZDpLK J6LUZVxNnLvQifhIRr5QOd+GcYiYzHJvG/7YDiZ6J8XD+AITblwmMnjSu4E59OGGbKdy buGnUuA15nh36FsOLjiqgZF/1ecN4SQX9EzuOtRJZw0iD3OgIrJCwf/qaBq0ZgD5AQBo X/QHaX20PJWWZ02Bmo7LP20As7iMCD/BnCrvNX2qmq7ZKpo9LtxDDkUDU//P6JJDaFzl 2xPg== 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=Thgi13qIfzYSuw7RSGc1PN1802oCbLzNal/a8MwzceY=; b=YozSm6QKytgxvck109cN8Q8Z3QQYUJkDp1mzt3u4gQ8eUZZB2xWi6VkcgxPY/Y0zfg akOcL3nNwQDR282xMrKBpx38pz654r5bUS5JuXGg+RjyVAVTfoGu8fC/CUcc/vxu72pU bCeHltCb6pM0R8bqCtaXrNojQDXBTwJRAxkTYBi5GZ9QLgh3LyQnSCVJRwbFUsOwavTq GfL3ky6tFxhGc0E0MIE6nm/4FXqTjJyDo9Qamu754uNmpuHelC/LaKBWYIRmE+gma28l QdAdV/KghTrTUdYuf02fRnOxU1lBVDJn3Q9HFML8nbdCaRXTeRQs+ivxBdQSJWMnndz+ CCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BQi+Cyud; 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 i7si3348008pgc.634.2017.10.26.05.58.50; Thu, 26 Oct 2017 05:58:50 -0700 (PDT) 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=BQi+Cyud; 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 S932396AbdJZM6t (ORCPT + 6 others); 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-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 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(-) -- 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;