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: 9564927 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 B6B4E60216 for ; Thu, 9 Feb 2017 15:36:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A57382853E for ; Thu, 9 Feb 2017 15:36:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A2B92853D; Thu, 9 Feb 2017 15:36:21 +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 44CA928535 for ; Thu, 9 Feb 2017 15:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752969AbdBIPgR (ORCPT ); Thu, 9 Feb 2017 10:36:17 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:35896 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753922AbdBIPgI (ORCPT ); Thu, 9 Feb 2017 10:36:08 -0500 Received: by mail-lf0-f47.google.com with SMTP id z134so4502597lff.3 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=UKXMM5IR1sgKgz2/V1Ql51edsDVtX6itvuTD5BS2AfZpWeDsqjYU4UHXplyMxsWZuR 5TXBx8NSkpIRwIQOL+pB8Nz9aZHvm8J9v4vRP6IfWwQlkg0e74si4acBDZy58kSJ87ox EYoKBfg5fHasT99m8XwyEzfEoxfqjB9G3C1Tqw1f8UuK4rBzXAlB+u1nrxTjj3C1R1oI GBsClQI1TRh9Bg4aG0Or34KkZO1kAP+Pjhnj2iYCkt2Z+dCzJWKqXIcHhOy+8hWh6eos txuA0JATsLJC/ZhgDhUP5lfnbsGrA1iwhuWneWEP/yVUUcI0HwVAYm09h/gBWPLjW5QJ YIWA== X-Gm-Message-State: AMke39lYpvSxpbN3Wq1ECcCQlUMHQ2wfZDTFTfeXHJx4oetjfA3ErH8nrooOXEMTrTh84Ouy 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-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 Reviewed-by: Bartlomiej Zolnierkiewicz --- 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 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;