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: 10028099 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 B9B456022E for ; Thu, 26 Oct 2017 12:58:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB3AA28DCD for ; Thu, 26 Oct 2017 12:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FE2C28DF5; Thu, 26 Oct 2017 12:58:50 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 94F0228DCD for ; Thu, 26 Oct 2017 12:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932395AbdJZM6s (ORCPT ); Thu, 26 Oct 2017 08:58:48 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:44062 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932228AbdJZM6s (ORCPT ); Thu, 26 Oct 2017 08:58:48 -0400 Received: by mail-lf0-f65.google.com with SMTP id 75so3659874lfx.1 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=YtwvyQUaWcY68ZdvVyvDFm64GkGMOaYeJ6gvknS+60tmyp+ubYNDABiozZ0IdDbu46 3t7Un2kkwB2BPPOUd4fvgEATy98eiec+7d3Peuqf0CuGIwi6lwEa/j6lFN8Q89lv2XUJ 24CAMD0zZ3KlhXSgoABteqC5ipwnnWnLnM5JQv5v/fFjLsEFj4dysv02T+92FPP7XcUt xzzcFyFWhyHLAwrfdUB3FaRSbwQAw0NMQE4XBaXScdkirN0Cfotk7zzamyaveeH06hY+ MphDwfRkS/ZS7h7IQ76xUvckCUcJe9ZY7vzpdsG695MAcJhXMJAfAw9IBfBY06N155DM Yo0w== X-Gm-Message-State: AMCzsaXPkjyue80BQAPe6geUQYhsmRtsvFUVvIddfwRT9p7l9g9tobpm 1gdREaYmQMg5XJ36AQGkoV+FFtUMGE0= 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-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 --- 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;