]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(stm32mp1): rework switch/case for MISRA
authorYann Gautier <yann.gautier@st.com>
Tue, 19 Oct 2021 11:31:06 +0000 (13:31 +0200)
committerYann Gautier <yann.gautier@st.com>
Tue, 1 Feb 2022 12:53:01 +0000 (13:53 +0100)
Avoid the use of return inside switch/case in stm32mp_is_single_core().
Although this MISRA rulre might not be enforced, we align on what is done
for stm32mp_is_auth_supported().

Change-Id: I00a5ec1b18c55b4254af00c9c5cf5a4dce104175
Signed-off-by: Yann Gautier <yann.gautier@st.com>
plat/st/stm32mp1/stm32mp1_private.c

index 51569758a85f078083eed94a5110984d13b22b21..9b39b9d3e6934da432b021204ce9f5d726e009ef 100644 (file)
@@ -420,15 +420,20 @@ void stm32mp_print_boardinfo(void)
 /* Return true when SoC provides a single Cortex-A7 core, and false otherwise */
 bool stm32mp_is_single_core(void)
 {
+       bool single_core = false;
+
        switch (get_part_number()) {
        case STM32MP151A_PART_NB:
        case STM32MP151C_PART_NB:
        case STM32MP151D_PART_NB:
        case STM32MP151F_PART_NB:
-               return true;
+               single_core = true;
+               break;
        default:
-               return false;
+               break;
        }
+
+       return single_core;
 }
 
 /* Return true when device is in closed state */