]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(st-clock): avoid arithmetics on pointers
authorYann Gautier <yann.gautier@st.com>
Fri, 25 Nov 2022 13:34:52 +0000 (14:34 +0100)
committerYann Gautier <yann.gautier@st.com>
Wed, 7 Dec 2022 13:18:31 +0000 (14:18 +0100)
This corrects MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.

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

drivers/st/clk/clk-stm32mp13.c

index faccfd4ea650230d7a8c6b6786143b3d5141d7e6..db427ad6f50a7f15b3a0cf90483032cb55f959c0 100644 (file)
@@ -2242,7 +2242,7 @@ static int stm32_clk_parse_fdt_all_pll(void *fdt, int node, struct stm32_clk_pla
        size_t i = 0U;
 
        for (i = _PLL1; i < pdata->npll; i++) {
-               struct stm32_pll_dt_cfg *pll = pdata->pll + i;
+               struct stm32_pll_dt_cfg *pll = &pdata->pll[i];
                char name[RCC_PLL_NAME_SIZE];
                int subnode = 0;
                int err = 0;