diff mbox series

mmc: am654_sdhci: Use MMC_MODES_END value instead of hardcoded value

Message ID 20200729013341.17785-1-faiz_abbas@ti.com
State Accepted
Commit 7d6f45a2109315740cc0b98c3facad1a239a1bd4
Delegated to: Lokesh Vutla
Headers show
Series mmc: am654_sdhci: Use MMC_MODES_END value instead of hardcoded value | expand

Commit Message

Faiz Abbas July 29, 2020, 1:33 a.m. UTC
The hardcoded array size leads to array overflows with changes in
speed modes enum in mmc core. Use MMC_MODES_END for otap_del_sel
array declaration to fix this.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
---
 drivers/mmc/am654_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peng Fan July 29, 2020, 2:08 a.m. UTC | #1
> Subject: [PATCH] mmc: am654_sdhci: Use MMC_MODES_END value instead
> of hardcoded value
> 
> The hardcoded array size leads to array overflows with changes in speed
> modes enum in mmc core. Use MMC_MODES_END for otap_del_sel array
> declaration to fix this.
> 
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> ---
>  drivers/mmc/am654_sdhci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/am654_sdhci.c b/drivers/mmc/am654_sdhci.c index
> cbc531dc53..82abf484e4 100644
> --- a/drivers/mmc/am654_sdhci.c
> +++ b/drivers/mmc/am654_sdhci.c
> @@ -75,7 +75,7 @@ struct am654_sdhci_plat {
>  	struct mmc mmc;
>  	struct regmap *base;
>  	bool non_removable;
> -	u32 otap_del_sel[11];
> +	u32 otap_del_sel[MMC_MODES_END];
>  	u32 trm_icp;
>  	u32 drv_strength;
>  	u32 strb_sel;

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.17.1
Lokesh Vutla Aug. 11, 2020, 10:37 a.m. UTC | #2
On 29/07/20 7:03 am, Faiz Abbas wrote:
> The hardcoded array size leads to array overflows with changes in
> speed modes enum in mmc core. Use MMC_MODES_END for otap_del_sel
> array declaration to fix this.
> 
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>

Applied to u-boot-ti

Thanks and regards,
Lokesh
diff mbox series

Patch

diff --git a/drivers/mmc/am654_sdhci.c b/drivers/mmc/am654_sdhci.c
index cbc531dc53..82abf484e4 100644
--- a/drivers/mmc/am654_sdhci.c
+++ b/drivers/mmc/am654_sdhci.c
@@ -75,7 +75,7 @@  struct am654_sdhci_plat {
 	struct mmc mmc;
 	struct regmap *base;
 	bool non_removable;
-	u32 otap_del_sel[11];
+	u32 otap_del_sel[MMC_MODES_END];
 	u32 trm_icp;
 	u32 drv_strength;
 	u32 strb_sel;