You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/30 15:03:47 UTC

[incubator-nuttx] 06/22: Fix error: variable 'lfbclk' is used uninitialized whenever switch case is taken [-Werror,-Wsometimes-uninitialized]

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit c701d1c6ecf1c6182a37f253db0290c11e29a19e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Oct 26 10:53:04 2022 +0800

    Fix error: variable 'lfbclk' is used uninitialized whenever switch case is taken [-Werror,-Wsometimes-uninitialized]
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/efm32/efm32_clockconfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/src/efm32/efm32_clockconfig.c b/arch/arm/src/efm32/efm32_clockconfig.c
index bd38e5c23e..91c006ec08 100644
--- a/arch/arm/src/efm32/efm32_clockconfig.c
+++ b/arch/arm/src/efm32/efm32_clockconfig.c
@@ -746,6 +746,7 @@ static inline uint32_t efm32_lfbclk_config(uint32_t lfbclksel, bool ulfrco,
           case CMU_LFCLKSEL_LFB_LFRCO:
             {
               efm32_enable_lfrco();
+              lfbclk = 0;
             }
             break;