Skip to content
  • Nathan Chancellor's avatar
    qed: Avoid implicit enum conversion in qed_set_tunn_cls_info · 76f86190
    Nathan Chancellor authored
    [ Upstream commit a898fba3 ]
    
    Clang warns when one enumerated type is implicitly converted to another.
    
    drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:163:25: warning:
    implicit conversion from enumeration type 'enum tunnel_clss' to
    different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion]
            p_tun->vxlan.tun_cls = type;
                                 ~ ^~~~
    drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:165:26: warning:
    implicit conversion from enumeration type 'enum tunnel_clss' to
    different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion]
            p_tun->l2_gre.tun_cls = type;
                                  ~ ^~~~
    drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:167:26: warning:
    implicit conversion from enumeration type 'enum tunnel_clss' to
    different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion]
            p_tun->ip_gre.tun_cls = type;
                                  ~ ^~~~
    drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:169:29: warning:
    implicit conversion from enumeration type 'enum tunnel_clss' to
    different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion]
            p_tun->l2_geneve.tun_cls = type;
                                     ~ ^~~~
    drivers/net/ethernet/qlogic/qed/qed_sp_commands.c:171:29: warning:
    implicit conversion from enumeration type 'enum tunnel_clss' to
    different enumeration type 'enum qed_tunn_clss' [-Wenum-conversion]
            p_tun->ip_geneve.tun_cls = type;
                                     ~ ^~~~
    5 warnings generated.
    
    Avoid this by changing type to an int.
    
    Link: https://github.com/ClangBuiltLinux/linux/issues/125
    
    
    Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    76f86190