clk: clk_stm32mp1: Fix warnings when compiling with W=1
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 21 Jun 2019 13:26:48 +0000 (15:26 +0200)
committerPatrick Delaunay <patrick.delaunay@st.com>
Fri, 12 Jul 2019 09:50:55 +0000 (11:50 +0200)
This patch solves the following warnings:

drivers/clk/clk_stm32mp1.c: In function 'stm32mp1_clk_get_parent':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < ARRAY_SIZE(stm32mp1_clks); i++)
                ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/clk/clk_stm32mp1.c

index 5f1585311498c65ea46b7f959d7f9b1af16ae1eb..6ffa05b8fd7c1d82806fa1327ad8fe9b344179d1 100644 (file)
@@ -805,10 +805,11 @@ static int stm32mp1_clk_get_parent(struct stm32mp1_clk_priv *priv,
        const struct stm32mp1_clk_sel *sel = priv->data->sel;
        int i;
        int s, p;
+       unsigned int idx;
 
-       for (i = 0; i < ARRAY_SIZE(stm32mp1_clks); i++)
-               if (stm32mp1_clks[i][0] == id)
-                       return stm32mp1_clks[i][1];
+       for (idx = 0; idx < ARRAY_SIZE(stm32mp1_clks); idx++)
+               if (stm32mp1_clks[idx][0] == id)
+                       return stm32mp1_clks[idx][1];
 
        i = stm32mp1_clk_get_id(priv, id);
        if (i < 0)