OSDN Git Service

net: stmmac: Fix mixed enum type warning
authorWong Vee Khee <vee.khee.wong@linux.intel.com>
Thu, 10 Jun 2021 08:53:54 +0000 (16:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jun 2021 20:56:48 +0000 (13:56 -0700)
The commit 5a5586112b92 ("net: stmmac: support FPE link partner
hand-shaking procedure") introduced the following coverity warning:

  "Parse warning (PW.MIXED_ENUM_TYPE)"
  "1. mixed_enum_type: enumerated type mixed with another type"

This is due to both "lo_state" and "lp_sate" which their datatype are
enum stmmac_fpe_state type, and being assigned with "FPE_EVENT_UNKNOWN"
which is a macro-defined of 0. Fixed this by assigned both these
variables with the correct enum value.

Fixes: 5a5586112b92 ("net: stmmac: support FPE link partner hand-shaking procedure")
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 180f347..db97cd4 100644 (file)
@@ -1021,8 +1021,8 @@ static void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up)
        if (is_up && *hs_enable) {
                stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY);
        } else {
-               *lo_state = FPE_EVENT_UNKNOWN;
-               *lp_state = FPE_EVENT_UNKNOWN;
+               *lo_state = FPE_STATE_OFF;
+               *lp_state = FPE_STATE_OFF;
        }
 }