From patchwork Thu Feb 9 15:33:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 93752 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp112195qgi; Thu, 9 Feb 2017 09:32:32 -0800 (PST) X-Received: by 10.98.62.153 with SMTP id y25mr5009843pfj.162.1486661552304; Thu, 09 Feb 2017 09:32:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si3457591plk.76.2017.02.09.09.32.32; Thu, 09 Feb 2017 09:32:32 -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 S932466AbdBIRcN (ORCPT + 5 others); Thu, 9 Feb 2017 12:32:13 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35104 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754343AbdBIRcL (ORCPT ); Thu, 9 Feb 2017 12:32:11 -0500 Received: by mail-lf0-f52.google.com with SMTP id n124so6629843lfd.2 for ; Thu, 09 Feb 2017 09:32:10 -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=yBj/RX3s/9Y2Y+Vve3S0fDZgFW5S2nqVcsZ/8X7wZkM=; b=Ul/BN0vsgKgsV0MNBnhg5Xy6T/2QYA0+Zz5w+b1ZDXCLtqxPXpR7YbU+uRwT9AUj11 R4zcZ7qXgqGJN08Azcw7KLYJF2wKDNO58ARbsy83D8GZ5Xuyn0Ugx/w3dV1lwKX4aMSX UPgiIVoOaWYLxom3q7neamluJL0ZLOhuhNOQY= 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=yBj/RX3s/9Y2Y+Vve3S0fDZgFW5S2nqVcsZ/8X7wZkM=; b=nub/vFN1dk9/Rinyp5qITrSjKAoYQzp9URJz7VAFUTS9ZV195sqfE57qSCXGWbfZaB ZDGYyvkwQBuNxl2t5KRl7Syp8hWLgF9LSn49unoSRxYO+X39gFuPPf/anHj0ofU0W23D Pu1NwQBxC7gJJzcl9DjRxWYi/Qheo2i0L4L/6edH3t055qPa1Ix0DdEJb1OP8Gkb4f/J MiQcLmKJs/rZpBTwKFXsJNc2AZiFlqwc28sH8enHLVfcEZOVa3nccD77OZuibIZQaczK 2iewCAJoAPwATLppR82K5SMTLzNS5fwT16NkgJvIqNVvOLOikJ2pfgsddRxpSGjs2fNY mc5A== X-Gm-Message-State: AMke39lxi9OUh8qSS046bISNhbuPh8a6490y7T6lY7gSB6BcP9QPUK+6cXuD/sG8U6tXnrBh X-Received: by 10.46.20.14 with SMTP id u14mr1403048ljd.30.1486654467651; Thu, 09 Feb 2017 07:34:27 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e86sm3670614lji.32.2017.02.09.07.34.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 07:34:26 -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 01/16] mmc: core: move some code in mmc_start_areq() Date: Thu, 9 Feb 2017 16:33:48 +0100 Message-Id: <20170209153403.9730-2-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 "previous" is a better name for the variable storing the previous asynchronous request, better than the opaque name "data" atleast. We see that we assign the return status to the returned variable on all code paths, so we might as well just do that immediately after calling mmc_finalize_areq(). Signed-off-by: Linus Walleij --- drivers/mmc/core/core.c | 13 +++++-------- 1 file changed, 5 insertions(+), 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/core.c b/drivers/mmc/core/core.c index 41b4cd01fccc..53065d1cebf7 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -683,7 +683,7 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host, { enum mmc_blk_status status; int start_err = 0; - struct mmc_async_req *data = host->areq; + struct mmc_async_req *previous = host->areq; /* Prepare a new request */ if (areq) @@ -691,13 +691,12 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host, /* Finalize previous request */ status = mmc_finalize_areq(host); + if (ret_stat) + *ret_stat = status; /* The previous request is still going on... */ - if (status == MMC_BLK_NEW_REQUEST) { - if (ret_stat) - *ret_stat = status; + if (status == MMC_BLK_NEW_REQUEST) return NULL; - } /* Fine so far, start the new request! */ if (status == MMC_BLK_SUCCESS && areq) @@ -716,9 +715,7 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host, else host->areq = areq; - if (ret_stat) - *ret_stat = status; - return data; + return previous; } EXPORT_SYMBOL(mmc_start_areq);