Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: stmmac: Fix mixed enum type warning

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>

authored by

Wong Vee Khee and committed by
David S. Miller
1f7096f0 f18c1181

+2 -2
+2 -2
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1021 1021 if (is_up && *hs_enable) { 1022 1022 stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY); 1023 1023 } else { 1024 - *lo_state = FPE_EVENT_UNKNOWN; 1025 - *lp_state = FPE_EVENT_UNKNOWN; 1024 + *lo_state = FPE_STATE_OFF; 1025 + *lp_state = FPE_STATE_OFF; 1026 1026 } 1027 1027 } 1028 1028