Skip to contentSkip to conversation

mmc: am654_sdhci: Use MMC_MODES_END value instead of hardcoded value

PATCH New Faiz Abbas 3 participants 3 messages Jul 29, 2020 – Aug 11, 2020 MMC, SD and SDIO

lore
Share & tools
lore

Faiz Abbas

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/mmc/am654_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/am654_sdhci.c +1 -1
index cbc531dc53..82abf484e4 100644
@@ -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;
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 mmc: am654_sdhci: Use MMC_MODES_END value instead of hardcoded value

Quoted 17 lines

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.

---
 drivers/mmc/am654_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/am654_sdhci.c index renamed from drivers/mmc/am654_sdhci.c +0 -0

cbc531dc53..82abf484e4 100644

drivers/mmc/am654_sdhci.c struct am654_sdhci_plat { · line 81

Quoted 8 lines
drivers/mmc/am654_sdhci.c +1 -1
@@ -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;
Quoted 2 lines

--
2.17.1

#2 lore raw

PATCH 1/1 mmc: am654_sdhci: Use MMC_MODES_END value instead of hardcoded value

In reply to Faiz Abbas
Quoted 5 lines · Faiz Abbas

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.

Applied to u-boot-ti

Thanks and regards,
Lokesh