public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val()
@ 2018-04-24 13:26 Dan Carpenter
  2018-04-25 12:37 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-04-24 13:26 UTC (permalink / raw)
  To: kernel-janitors

We were supposed to go through this loop twice but there is a missing if
statement so it only loops once.

Fixes: 213fae74318b ("mmc: sdhci-cadence: send tune request twice to work around errata")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
index bc30d1637246..7a343b87b5e5 100644
--- a/drivers/mmc/host/sdhci-cadence.c
+++ b/drivers/mmc/host/sdhci-cadence.c
@@ -274,8 +274,8 @@ static int sdhci_cdns_set_tune_val(struct sdhci_host *host, unsigned int val)
 		ret = readl_poll_timeout(reg, tmp,
 					 !(tmp & SDHCI_CDNS_HRS06_TUNE_UP),
 					 0, 1);
-
-		return ret;
+		if (ret)
+			return ret;
 	}
 
 	return 0;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val()
  2018-04-24 13:26 [PATCH] mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val() Dan Carpenter
@ 2018-04-25 12:37 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2018-04-25 12:37 UTC (permalink / raw)
  To: kernel-janitors

2018-04-24 22:26 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
> We were supposed to go through this loop twice but there is a missing if
> statement so it only loops once.
>
> Fixes: 213fae74318b ("mmc: sdhci-cadence: send tune request twice to work around errata")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>


Thanks for the fix, but
an equivalent patch had already been applied.

https://patchwork.kernel.org/patch/10351215/



> diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
> index bc30d1637246..7a343b87b5e5 100644
> --- a/drivers/mmc/host/sdhci-cadence.c
> +++ b/drivers/mmc/host/sdhci-cadence.c
> @@ -274,8 +274,8 @@ static int sdhci_cdns_set_tune_val(struct sdhci_host *host, unsigned int val)
>                 ret = readl_poll_timeout(reg, tmp,
>                                          !(tmp & SDHCI_CDNS_HRS06_TUNE_UP),
>                                          0, 1);
> -
> -               return ret;
> +               if (ret)
> +                       return ret;
>         }
>
>         return 0;
> --
> 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



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-25 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-24 13:26 [PATCH] mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val() Dan Carpenter
2018-04-25 12:37 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox