From patchwork Wed Feb 13 19:54:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10810815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75F29746 for ; Wed, 13 Feb 2019 19:54:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 660C22DD3E for ; Wed, 13 Feb 2019 19:54:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 596452DD51; Wed, 13 Feb 2019 19:54:53 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 0511A2DD3E for ; Wed, 13 Feb 2019 19:54:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403866AbfBMTyw (ORCPT ); Wed, 13 Feb 2019 14:54:52 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46191 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727921AbfBMTyw (ORCPT ); Wed, 13 Feb 2019 14:54:52 -0500 Received: by mail-lj1-f193.google.com with SMTP id v16so3081386ljg.13 for ; Wed, 13 Feb 2019 11:54:50 -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=kgDHFK57CR5Ay9YIhXMb7cC0cVszsj4VLxkHuyRddxQ=; b=xOCJNm27TfkIi15lyMEIHxeKSnhUIBjot1Fb25S2CrRJXpom8eaFnSrmOGQdPDmSVs 2hx9KN2YK3AzAGqtBcXoyFdayudBSRbbuSlw4Bd7/TU1ZMcG2wDUY06gpcEMbXMOIZOa Zw84ekiFfKn78MZNai0V7Qjwa8wys7h0uEp6dRrit0TqnvVKsDSS/d5PWLBBBfjY8dg2 YIIVVKVvWET/bhmBu0qCM8XU0AzeQhP63cCm4bjzzu5e6Ul0f+c7L/SF0NrFhmugosgu PI2z2abIDzVFzxllVm1HJex3Z4WKgYQS0KIV/yOtOj+tCIU9fhGxZoLUL6rUmfT0VR0R M/vA== 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=kgDHFK57CR5Ay9YIhXMb7cC0cVszsj4VLxkHuyRddxQ=; b=pwA5TJNzAmSlegLbPhS/MLxSAAFNYjJwtScBa64CwRT6BUJ2BJnhOv3L4uXajQN53n 2RXWLTMTsKuBFXUyFaFfoIWyOLQD83dK+LWTXCAXKbn5rwIUavc1UvLw8JoiM3Qd7D8K 69d/OCmfHDssKFMeDFR6tmCn9VisIrcolRSEbuXEbza/4MqC1TRJluOGr1zADTve6JXb /xdSbf3PVEUa3/sJhYP3chftvMmRMNqtxdHbpcpNFZGCW587YU8ASUjtFFmPNtNfy3Lp Z2xodiQeBMJ8NtnM3pScEYEA9IqcNEtF+2p0k/2JKBHMZVXMqy1bet91cpPqq9fQet4O 8thA== X-Gm-Message-State: AHQUAuZKiBHP110qqweDXlwrAAddJLCu15v5kUTQG/24tDWCJrWJacD+ pU7nrz+QVIxU4BbA5BTyeGs/s9nPmV0= X-Google-Smtp-Source: AHgI3IacToGuGXv9lHW94N1a289/vGrNE7DAZqITplA38dCMeFhuV9glQ+G+qcWSfHRP0lKlZcIsTQ== X-Received: by 2002:a2e:8585:: with SMTP id b5mr1323808lji.125.1550087689729; Wed, 13 Feb 2019 11:54:49 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id g194sm39169lfg.55.2019.02.13.11.54.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 11:54:49 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Adrian Hunter Cc: Ulf Hansson Subject: [PATCH 2/7] mmc: core: Drop retries as in-parameter to mmc_wait_for_app_cmd() Date: Wed, 13 Feb 2019 20:54:38 +0100 Message-Id: <20190213195443.18935-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213195443.18935-1-ulf.hansson@linaro.org> References: <20190213195443.18935-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All callers of mmc_wait_for_app_cmd() set the retries in-parameter to MMC_CMD_RETRIES. This is silly, so let's just drop the in-parameter altogether, as to simplify the code. Signed-off-by: Ulf Hansson --- drivers/mmc/core/sd_ops.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index 39be4d64bc68..0bb0b8419016 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c @@ -53,22 +53,16 @@ int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card) EXPORT_SYMBOL_GPL(mmc_app_cmd); static int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card, - struct mmc_command *cmd, int retries) + struct mmc_command *cmd) { struct mmc_request mrq = {}; - - int i, err; - - if (retries < 0) - retries = MMC_CMD_RETRIES; - - err = -EIO; + int i, err = -EIO; /* * We have to resend MMC_APP_CMD for each attempt so * we cannot use the retries field in mmc_command. */ - for (i = 0;i <= retries;i++) { + for (i = 0; i <= MMC_CMD_RETRIES; i++) { err = mmc_app_cmd(host, card); if (err) { /* no point in retrying; no APP commands allowed */ @@ -121,7 +115,7 @@ int mmc_app_set_bus_width(struct mmc_card *card, int width) return -EINVAL; } - return mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES); + return mmc_wait_for_app_cmd(card->host, card, &cmd); } int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) @@ -137,7 +131,7 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; for (i = 100; i; i--) { - err = mmc_wait_for_app_cmd(host, NULL, &cmd, MMC_CMD_RETRIES); + err = mmc_wait_for_app_cmd(host, NULL, &cmd); if (err) break;