From patchwork Tue Jan 24 10:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9534781 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 7F1D16042D for ; Tue, 24 Jan 2017 10:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 707FB24DA2 for ; Tue, 24 Jan 2017 10:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 656CF26C2F; Tue, 24 Jan 2017 10:18:25 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 0E44C24DA2 for ; Tue, 24 Jan 2017 10:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750966AbdAXKSY (ORCPT ); Tue, 24 Jan 2017 05:18:24 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:36266 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbdAXKSX (ORCPT ); Tue, 24 Jan 2017 05:18:23 -0500 Received: by mail-lf0-f53.google.com with SMTP id z134so108127486lff.3 for ; Tue, 24 Jan 2017 02:18: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=gz7tnq07zJ9ndl16kODpy5LyxxSK4/Ig/Iysr1h95GU=; b=Yrv1lbsBQA8mcks0TxP2rUqpNQJWj9Y06iheVlBdpEAxO6fXvWv1H3PniSo8vYpGZL m6Us+9UBfFZI8l48OJQl8sRnfUhnCgcRSWjjaet1CXeVWhWBDOkZLQOyPDpclWBRBjZv 9tZBRJDwxSBS7f6O1ZeslK3l96m89jgIbKGws= 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=gz7tnq07zJ9ndl16kODpy5LyxxSK4/Ig/Iysr1h95GU=; b=bZdqvDDW801OGITZAYKyXnuKjZ2I/rvJXLr2R0gLkNBUQkRFNyZQ+22P2uqPoYZo2U RqVcC325Q/tjcZVJC/ixbs6sVYORh0zs6xUfQgfRMBszeka6hYgMQoZbjPHrxJpaGUiI xephiKqhNZlUoROVfumCBlxy4t6Jk/JCzBAAFi32rvCfKKHmcZU/5fkTRItvNrRl9niH qQC/93G3XAVRIHU/D4Uff50yQcRN7UkTSiB2SK5k3vVp+Z2ZkojhTSPQ9LHZGkg4P4Xw JQX3BZctc7QgW7udJGo1AtXtpXAJpYOXGwLWDChTBi3uA1iMDW0e28mbHS6UPgtWRlzb BZQg== X-Gm-Message-State: AIkVDXIHT7fkl/+Y3PvqZpg0HVIibR6JK7FKRxgH1sr4+y0alcN49JOkaX4AZ5bgmWZnRRLo X-Received: by 10.46.33.136 with SMTP id h8mr13907712lji.57.1485253101696; Tue, 24 Jan 2017 02:18:21 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o91sm7410797lfg.17.2017.01.24.02.18.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 02:18:20 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, linux-block@vger.kernel.org, Ulf Hansson Cc: Chunyan Zhang , Baolin Wang , Paolo Valente , Linus Walleij Subject: [PATCH 5/6] mmc: block: introduce new_areq and old_areq Date: Tue, 24 Jan 2017 11:17:56 +0100 Message-Id: <20170124101757.19676-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170124101757.19676-1-linus.walleij@linaro.org> References: <20170124101757.19676-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 Recycling the same variable in an x=x+1 fashion may seem clever here but it makes the code terse and hard to follow for humans. Introduce a new_areq and old_areq variable so we see what is going on. Signed-off-by: Linus Walleij --- drivers/mmc/core/block.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 4bbb3d16c09b..f3e0c778cdbd 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1631,7 +1631,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc) enum mmc_blk_status status; struct mmc_queue_req *mq_rq; struct request *req; - struct mmc_async_req *areq; + struct mmc_async_req *new_areq; + struct mmc_async_req *old_areq; if (!rqc && !mq->mqrq_prev->req) return 0; @@ -1651,11 +1652,12 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc) } mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq); - areq = &mq->mqrq_cur->mmc_active; + new_areq = &mq->mqrq_cur->mmc_active; } else - areq = NULL; - areq = mmc_start_req(card->host, areq, &status); - if (!areq) { + new_areq = NULL; + + old_areq = mmc_start_req(card->host, new_areq, &status); + if (!old_areq) { /* * We have just put the first request into the pipeline * and there is nothing more to do until it is @@ -1670,7 +1672,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc) * An asynchronous request has been completed and we proceed * to handle the result of it. */ - mq_rq = container_of(areq, struct mmc_queue_req, mmc_active); + mq_rq = container_of(old_areq, struct mmc_queue_req, mmc_active); brq = &mq_rq->brq; req = mq_rq->req; type = rq_data_dir(req) == READ ? MMC_BLK_READ : MMC_BLK_WRITE;