diff mbox series

[net-next,v1,1/1] net: stmmac: Fix mixed enum type warning

Message ID 20210610085354.656580-1-vee.khee.wong@linux.intel.com (mailing list archive)
State Accepted
Commit 1f7096f0fdb2ac5ae6f1e290dfdd2fb7bbb074d3
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1,1/1] net: stmmac: Fix mixed enum type warning | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 4 blamed authors not CCed: boon.leong.ong@intel.com weifeng.voon@intel.com tee.min.tan@intel.com mohammad.athari.ismail@intel.com; 4 maintainers not CCed: boon.leong.ong@intel.com weifeng.voon@intel.com tee.min.tan@intel.com mohammad.athari.ismail@intel.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Wong Vee Khee June 10, 2021, 8:53 a.m. UTC
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>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 10, 2021, 9 p.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 10 Jun 2021 16:53:54 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v1,1/1] net: stmmac: Fix mixed enum type warning
    https://git.kernel.org/netdev/net-next/c/1f7096f0fdb2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 180f347b4c8e..db97cd4b871d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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;
 	}
 }