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: 158246 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp470085jaa; Wed, 13 Feb 2019 11:54:50 -0800 (PST) X-Received: by 2002:ac2:4219:: with SMTP id y25mr1348016lfh.130.1550087690242; Wed, 13 Feb 2019 11:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550087690; cv=none; d=google.com; s=arc-20160816; b=eXir38mGI2kp1r6B7aGmnIsxCPYVAf6wjIUnhVT2eSlunA01YH8pIUNGFsEOSL3OsN 4M47d6vmd9Y+BsfzrnTcWlR+qa0qB0IwKgaii8od9imm13S1/wuYbmhyC//ytqoWqdUs sEyOTAjcapCmqxsMifTsAg6XGnCIK5Vlmzee2ZOILrFn5mygRLQ55G7DcEqXSTLqDtlF 148u9zzVz0Izkaqlos3ChcsfebMhrr8C2scIfr8HVzLnyBP0dba6B5qMTV34T93kak0e VG0TZKqma5jrAENCUfUXu8xPJwTNMOMJO1EG1Qeqpahjei1fyYkQE3eA5SQ4ag2VNhOg rf5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kgDHFK57CR5Ay9YIhXMb7cC0cVszsj4VLxkHuyRddxQ=; b=cO+EnFrJBddsnGl48ixNiRRT1c+FDN1pBSdCFDe3TO+COQdypW1Qgj3YZzARDT4CQL 2sI9TeSZU7PcJmWiQVialkm1TV8qmrR0uCSzU1hXzC9tvuRluF4eM4vbmI3nyDiybGQB WR/XKEPBbVEQMnsjg7u8bLcdKg1oEnN9kpA6wUjIX2+w1HBeFiFDe6RvettGRC1VunAz JBfZwx7rFwF+nZV6AQzyFxD//Fj9yNx4dRtkRnd4DfjK+xZmIrEbfWXHMkMMM1L9shI8 z32HEYs2XHEHlytJZsZmHC9/dUDCgLpXId41VR/aljj0aLZ6jSqotWsZHeAk6jL8HMLE rCsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xOCJNm27; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l20-v6sor138681lji.21.2019.02.13.11.54.50 for (Google Transport Security); Wed, 13 Feb 2019 11:54:50 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xOCJNm27; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=WwtxxocTQ9wHXg3mCXd+Fh1Y2jFhQ7ETjic2NC1NoGE48hHCgRF7WPR+GjNs9xUMjz ko+hDKUmq6nOWDH4YUMF2wB0arWpmrpXac8gB3POKNrnUBtdYG2ML26R1GGgkPOhPlwA OwrtRnI2bYjs44yae7u8RrJF07E2V02/z/N9yf52lp1sq5PUEOMxXB+CIYcDdHm/FCV3 OmUXB2TRAEYX0vzjfpu98WmY+D2bpE2QB6p6/ru+SlllmjDNxp39YYMRsAARkNg7Op1t DftJ7ctUdGBOL2rzmTEbcBlRykFIHM0hk5hkI3OcfR1vXCvdaazw4BDCO+S4BMkcKQuZ uktw== X-Gm-Message-State: AHQUAuYtX9sIcm1jDwCakt3uMs4Ag+SE0/pWykXNfAqISo0n8+e71n71 DETigO/vinR8f0rRl0V58PF9/5H9/rhOqg== 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) Return-Path: 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> 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(-) -- 2.17.1 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;