Skip to content

Commit 8fa74e3

Browse files
nathanchancedavem330
authored andcommitted
qed: Avoid implicit enum conversion in qed_ooo_submit_tx_buffers
Clang warns when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_ll2.c:799:32: warning: implicit conversion from enumeration type 'enum core_tx_dest' to different enumeration type 'enum qed_ll2_tx_dest' [-Wenum-conversion] tx_pkt.tx_dest = p_ll2_conn->tx_dest; ~ ~~~~~~~~~~~~^~~~~~~ 1 warning generated. Fix this by using a switch statement to convert between the enumerated values since they are not 1 to 1, which matches how the rest of the driver handles this conversion. Link: ClangBuiltLinux#125 Suggested-by: Tomer Tayar <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: Tomer Tayar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9e50727 commit 8fa74e3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/net/ethernet/qlogic/qed/qed_ll2.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,18 @@ qed_ooo_submit_tx_buffers(struct qed_hwfn *p_hwfn,
796796
tx_pkt.vlan = p_buffer->vlan;
797797
tx_pkt.bd_flags = bd_flags;
798798
tx_pkt.l4_hdr_offset_w = l4_hdr_offset_w;
799-
tx_pkt.tx_dest = p_ll2_conn->tx_dest;
799+
switch (p_ll2_conn->tx_dest) {
800+
case CORE_TX_DEST_NW:
801+
tx_pkt.tx_dest = QED_LL2_TX_DEST_NW;
802+
break;
803+
case CORE_TX_DEST_LB:
804+
tx_pkt.tx_dest = QED_LL2_TX_DEST_LB;
805+
break;
806+
case CORE_TX_DEST_DROP:
807+
default:
808+
tx_pkt.tx_dest = QED_LL2_TX_DEST_DROP;
809+
break;
810+
}
800811
tx_pkt.first_frag = first_frag;
801812
tx_pkt.first_frag_len = p_buffer->packet_length;
802813
tx_pkt.cookie = p_buffer;

0 commit comments

Comments
 (0)