<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 6/7/24 14:48, Marek Vasut wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:6f44537a-3d60-46f5-a159-919cc2a144ec@denx.de">On 6/7/24
      11:57 AM, Christophe Roullier wrote:
      <br>
      <br>
      [...]
      <br>
      <br>
      <blockquote type="cite">@@ -224,11 +225,18 @@ static int
        stm32mp1_configure_pmcr(struct plat_stmmacenet_data *plat_dat)
        <br>
          {
        <br>
              struct stm32_dwmac *dwmac = plat_dat->bsp_priv;
        <br>
              u32 reg = dwmac->mode_reg;
        <br>
        -    int val;
        <br>
        +    int val = 0;
        <br>
      </blockquote>
      <br>
      Is the initialization really needed ? It seems the switch-case
      below does always initialize $val .
      <br>
    </blockquote>
    <p>Yes it is needed otherwise:</p>
    <pre class="moz-quote-pre" wrap=""></pre>
    <blockquote type="cite" style="color: #007cff;">
      <blockquote type="cite" style="color: #007cff;">
        <pre class="moz-quote-pre" wrap="">drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c:239:4: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
</pre>
      </blockquote>
    </blockquote>
    <pre class="moz-quote-pre" wrap="">val |= SYSCFG_PMCR_ETH_SEL_MII;
                           ^~~
   drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c:228:9: note: initialize the variable 'val' to silence this warning
           int val;</pre>
    <p></p>
    <blockquote type="cite"
      cite="mid:6f44537a-3d60-46f5-a159-919cc2a144ec@denx.de">
      <br>
      <blockquote type="cite">      switch (plat_dat->mac_interface)
        {
        <br>
              case PHY_INTERFACE_MODE_MII:
        <br>
        -        val = SYSCFG_PMCR_ETH_SEL_MII;
        <br>
        +        /*
        <br>
        +         * STM32MP15xx supports both MII and GMII, STM32MP13xx
        MII only.
        <br>
        +         * SYSCFG_PMCSETR ETH_SELMII is present only on
        STM32MP15xx and
        <br>
        +         * acts as a selector between 0:GMII and 1:MII. As
        STM32MP13xx
        <br>
        +         * supports only MII, ETH_SELMII is not present.
        <br>
        +         */
        <br>
        +        if (!dwmac->ops->is_mp13)  /* Select MII mode on
        STM32MP15xx */
        <br>
        +            val |= SYSCFG_PMCR_ETH_SEL_MII;
        <br>
                  break;
        <br>
              case PHY_INTERFACE_MODE_GMII:
        <br>
                  val = SYSCFG_PMCR_ETH_SEL_GMII;
        <br>
      </blockquote>
      <br>
      [...]
      <br>
      <br>
      This way of adding MP13 support definitely looks much better.
      <br>
      <br>
      Also, split the series, drivers/ stuff for netdev (and make sure
      to include the net-next patch prefix , git send-email
      --subject-prefix="net-next,PATCH") , DTs for linux-arm-kernel ,
      config patch also for linux-arm-kernel .
      <br>
    </blockquote>
  </body>
</html>