]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(st): use Boolean type for tests
authorYann Gautier <yann.gautier@st.com>
Mon, 21 Nov 2022 12:26:37 +0000 (13:26 +0100)
committerYann Gautier <yann.gautier@st.com>
Wed, 7 Dec 2022 13:20:01 +0000 (14:20 +0100)
This corrects MISRA C2012-14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ibed7b87b50959f03dc5550dfaffacafd1d79feee

plat/st/common/stm32mp_dt.c

index 6ec428c578157506fb851f741b466909067b6029..34d52e1d7b44e6f8908654531d752d6fe8d88451 100644 (file)
@@ -347,7 +347,7 @@ int dt_find_otp_name(const char *name, uint32_t *otp, uint32_t *otp_len)
                return -FDT_ERR_BADVALUE;
        }
 
-       if (fdt32_to_cpu(*cuint) % sizeof(uint32_t)) {
+       if ((fdt32_to_cpu(*cuint) % sizeof(uint32_t)) != 0U) {
                ERROR("Misaligned nvmem %s element: ignored\n", name);
                return -FDT_ERR_BADVALUE;
        }