cxgb4: Use proper enum in IEEE_FAUX_SYNC
Subsystems (3)
PATCH 1/1 cxgb4: Use proper enum in IEEE_FAUX_SYNC
Clang warns when one enumerated type is implicitly converted to another.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c:390:4: warning: implicit conversion from enumeration type 'enum cxgb4_dcb_state' to different enumeration type 'enum cxgb4_dcb_state_input' [-Wenum-conversion]
IEEE_FAUX_SYNC(dev, dcb);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h:70:10: note: expanded
from macro 'IEEE_FAUX_SYNC'
CXGB4_DCB_STATE_FW_ALLSYNCED);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~Use the equivalent value of the expected type to silence Clang while resulting in no functional change.
CXGB4_DCB_STATE_FW_ALLSYNCED = CXGB4_DCB_INPUT_FW_ALLSYNCED = 3
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h +1 -1
@@ -67,7 +67,7 @@do { \if ((__dcb)->dcb_version ==FW_PORT_DCB_VER_IEEE ) \cxgb4_dcb_state_fsm ((__dev), \ -CXGB4_DCB_STATE_FW_ALLSYNCED ); \ +CXGB4_DCB_INPUT_FW_ALLSYNCED ); \ }while (0 )/* States we can be in for a port's Data Center Bridging.
Signature · 1 line
2.19.0
Quoted 6 lines · Nathan Chancellor
Clang warns when one enumerated type is implicitly converted to another.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c:390:4: warning: implicit conversion from enumeration type 'enumcxgb4_dcb_state' to different enumeration type 'enumcxgb4_dcb_state_input' [-Wenum-conversion]
Luckily these 2 enums had the same values, so this change is no functional change. Thanks for the patch!
Quoted 33 lines
IEEE_FAUX_SYNC(dev, dcb); ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h:70:10: note: expanded from macro 'IEEE_FAUX_SYNC' CXGB4_DCB_STATE_FW_ALLSYNCED); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~Use the equivalent value of the expected type to silence Clang while resulting in no functional change.
CXGB4_DCB_STATE_FW_ALLSYNCED=CXGB4_DCB_INPUT_FW_ALLSYNCED= 3Signed-off-by Nathan Chancellor <[email protected]>--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h +1
-2@@ -67,7 +67,7 @@do { \if ((__dcb)->dcb_version ==FW_PORT_DCB_VER_IEEE ) \cxgb4_dcb_state_fsm ((__dev), \ -CXGB4_DCB_STATE_FW_ALLSYNCED ); \ +CXGB4_DCB_INPUT_FW_ALLSYNCED ); \ }while (0 )/* States we can be in for a port's Data Center Bridging. -- 2.19.0
Signature · 2 lines
Thanks, ~Nick Desaulniers
From: Nathan Chancellor <[email protected]>
Date: Sun, 30 Sep 2018 20:47:38 -0700
Quoted 12 lines
Clang warns when one enumerated type is implicitly converted to another.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c:390:4: warning: implicit conversion from enumeration type 'enumcxgb4_dcb_state' to different enumeration type 'enumcxgb4_dcb_state_input' [-Wenum-conversion]IEEE_FAUX_SYNC(dev, dcb); ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h:70:10: note: expanded from macro 'IEEE_FAUX_SYNC' CXGB4_DCB_STATE_FW_ALLSYNCED); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
Use the equivalent value of the expected type to silence Clang while resulting in no functional change.
CXGB4_DCB_STATE_FW_ALLSYNCED=CXGB4_DCB_INPUT_FW_ALLSYNCED= 3Signed-off-by Nathan Chancellor <[email protected]>
Applied to net-next.