lkml.org 
[lkml]   [2019]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 038/122] cxgb4: Use proper enum in IEEE_FAUX_SYNC
    Date
    From: Nathan Chancellor <natechancellor@gmail.com>

    [ Upstream commit 258b6d141878530ba1f8fc44db683822389de914 ]

    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

    Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h
    index ccf24d3dc9824..2c418c405c508 100644
    --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h
    +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h
    @@ -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.20.1


    \
     
     \ /
      Last update: 2019-11-22 11:51    [W:4.819 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site