From patchwork Thu Feb 9 15:33:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 93722 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp81264obz; Thu, 9 Feb 2017 07:36:25 -0800 (PST) X-Received: by 10.84.193.36 with SMTP id e33mr5028459pld.4.1486654585490; Thu, 09 Feb 2017 07:36:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si10315679pga.393.2017.02.09.07.36.25; Thu, 09 Feb 2017 07:36:25 -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; 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 S1752685AbdBIPgQ (ORCPT + 5 others); Thu, 9 Feb 2017 10:36:16 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:35040 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753923AbdBIPgI (ORCPT ); Thu, 9 Feb 2017 10:36:08 -0500 Received: by mail-lf0-f47.google.com with SMTP id n124so4533148lfd.2 for ; Thu, 09 Feb 2017 07:35:22 -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=5cBy3a2SdO/KkSMLpJs+N9esxzJ6Dg/TfJOs50r40CA=; b=IuKPuttp3UNMkRzwU7SYHJLK0VQwfm1ur0OvS2ibIfNFZR/ryVarWzlNRV5BKwHpMg R/droVIEDUIK/AmrYJn7sa3vtY3zuNSeHLPSmdbXmVT6XUm59LZwW/81qwRqGxEsMywi lEBEgB3ZX5En8fqD0Y3icZcHRPEuC3fqy10ik= 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=5cBy3a2SdO/KkSMLpJs+N9esxzJ6Dg/TfJOs50r40CA=; b=gWi/ioV9Bh2FanexaD7k46/V1KXfzgjX8a1XN19eD2rAqFvU4ox0fq0/iCDqDiGLCs 7KDoUVCCGaBDHRxeSqlaMDDWBAzFpDG7y4HveskVp7TM75GoM4kTEwtQaVBTVTbAJBRJ Ue9/M2CV4S9Nixg6/Tvs2kJsqzBNSM34GEMI2VMHiklisK0h4n09lrJbPtN+mY2h5uJg oWTtoYkWuhzLKQGnj0QeG1b8Na5AeOVTg8ZQbzF/eQW2Jq2Z8U3cpCbkTo57mJoki+96 ggM7Y9QktTOslYTMOY3ETxnb5v1o6NfAis6s3oJFRC90JF5x+EMBrY80zHO7Fd+tjw1V 2zDA== X-Gm-Message-State: AMke39kVucumxAh1Ak8UOUdTH1UwT4n14SxPb+RsonooypaToqE8XBC99O+A80SMlntZB1cc X-Received: by 10.25.104.20 with SMTP id d20mr1378164lfc.108.1486654516308; Thu, 09 Feb 2017 07:35:16 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e86sm3670614lji.32.2017.02.09.07.35.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 07:35:15 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Paolo Valente Cc: Chunyan Zhang , Baolin Wang , linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Linus Walleij Subject: [PATCH 10/16] mmc: queue: simplify queue logic Date: Thu, 9 Feb 2017 16:33:57 +0100 Message-Id: <20170209153403.9730-11-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170209153403.9730-1-linus.walleij@linaro.org> References: <20170209153403.9730-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.9.3 -- 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 Reviewed-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index a845fe8d4fd1..bc116709c806 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -64,14 +64,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->mqrq_prev->req) - mq->asleep = true; - } mq->mqrq_cur->req = req; spin_unlock_irq(q->queue_lock); @@ -95,6 +87,7 @@ static int mmc_queue_thread(void *d) mq->mqrq_prev->req = NULL; swap(mq->mqrq_prev, mq->mqrq_cur); } else { + mq->asleep = true; if (kthread_should_stop()) { set_current_state(TASK_RUNNING); break;