From b599fdbc0ea249791e989cf594aaa63c8e21581d Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 4 Mar 2024 13:28:32 +0800 Subject: [PATCH] stm32: fix compile failed Error: chip/stm32_sdmmc.c:1911:7: error: variable 'regaddress' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 1911 | if (priv->base == STM32_SDMMC1_BASE) Signed-off-by: ligd --- arch/arm/src/stm32h7/stm32_sdmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32h7/stm32_sdmmc.c b/arch/arm/src/stm32h7/stm32_sdmmc.c index faf70a42af..fe780234ca 100644 --- a/arch/arm/src/stm32h7/stm32_sdmmc.c +++ b/arch/arm/src/stm32h7/stm32_sdmmc.c @@ -1900,8 +1900,8 @@ static void stm32_reset(struct sdio_dev_s *dev) struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; irqstate_t flags; uint32_t regval; - uint32_t regaddress; - uint32_t restval; + uint32_t regaddress = 0; + uint32_t restval = 0; /* Disable clocking */