Skip to contentSkip to conversation

mmc: renesas_sdhi: simplify execute_tuning

PATCH In review Wolfram Sang 2 participants 2 messages Feb 13, 2020

Subsystems (2)
lore
Share & tools
lore

Wolfram Sang

author maintainer
#0 lore raw

PATCH 1/1 mmc: renesas_sdhi: simplify execute_tuning

After refactoring, 'ret' variable is superfluous. Remove it.

---

Tested on a Salvator-XS (R-Car M3-N). Tuning to HS400 works, checksumming a large file works with no performance regression.

 drivers/mmc/host/renesas_sdhi_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +2 -3
index 0f07cc1aee34..df826661366f 100644
@@ -497,7 +497,7 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
 static int renesas_sdhi_execute_tuning(struct tmio_mmc_host *host, u32 opcode)
 {
 	struct renesas_sdhi *priv = host_to_priv(host);
-	int i, ret;
+	int i;
 
 	priv->tap_num = renesas_sdhi_init_tuning(host);
 	if (!priv->tap_num)
@@ -517,8 +517,7 @@ static int renesas_sdhi_execute_tuning(struct tmio_mmc_host *host, u32 opcode)
 		/* Set sampling clock position */
 		sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
 
-		ret = mmc_send_tuning(host->mmc, opcode, NULL);
-		if (ret == 0)
+		if (mmc_send_tuning(host->mmc, opcode, NULL) == 0)
 			set_bit(i, priv->taps);
 	}
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Wolfram,

Thanks for your work.

Quoted 3 lines · Wolfram Sang

After refactoring, 'ret' variable is superfluous. Remove it.

Quoted 34 lines

---

Tested on a Salvator-XS (R-Car M3-N). Tuning to HS400 works, checksumming a large file works with no performance regression.

 drivers/mmc/host/renesas_sdhi_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +2 -3
index 0f07cc1aee34..df826661366f 100644
@@ -497,7 +497,7 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
 static int renesas_sdhi_execute_tuning(struct tmio_mmc_host *host, u32 opcode)
 {
 	struct renesas_sdhi *priv = host_to_priv(host);
-	int i, ret;
+	int i;
 
 	priv->tap_num = renesas_sdhi_init_tuning(host);
 	if (!priv->tap_num)
@@ -517,8 +517,7 @@ static int renesas_sdhi_execute_tuning(struct tmio_mmc_host *host, u32 opcode)
 		/* Set sampling clock position */
 		sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
 
-		ret = mmc_send_tuning(host->mmc, opcode, NULL);
-		if (ret == 0)
+		if (mmc_send_tuning(host->mmc, opcode, NULL) == 0)
 			set_bit(i, priv->taps);
 	}
 
Signature · 1 line
2.20.1
Signature · 2 lines
Regards,
Niklas Söderlund