Skip to content

Commit aef716f

Browse files
nathanchancejgunthorpe
authored andcommitted
RDMA/qedr: Remove enumerated type qed_roce_ll2_tx_dest
Clang warns when one enumerated type is explicitly converted to another. drivers/infiniband/hw/qedr/qedr_roce_cm.c:198:28: warning: implicit conversion from enumeration type 'enum qed_roce_ll2_tx_dest' to different enumeration type 'enum qed_ll2_tx_dest' [-Wenum-conversion] ll2_tx_pkt.tx_dest = pkt->tx_dest; ~ ~~~~~^~~~~~~ 1 warning generated. Turns out that QED_ROCE_LL2_TX_DEST_NW and QED_ROCE_LL2_TX_DEST_LB are only used once in the whole tree and QED_ROCE_LL2_TX_DEST_MAX is used nowhere. Remove them and use the equivalent values from qed_ll2_tx_dest in their place. Reported-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Acked-by: Michal Kalderon <michal.kalderon@cavium.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 935c84a commit aef716f

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

‎drivers/infiniband/hw/qedr/qedr_roce_cm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ static inline int qedr_gsi_build_packet(struct qedr_dev *dev,
519519
}
520520

521521
if (ether_addr_equal(udh.eth.smac_h, udh.eth.dmac_h))
522-
packet->tx_dest = QED_ROCE_LL2_TX_DEST_LB;
522+
packet->tx_dest = QED_LL2_TX_DEST_LB;
523523
else
524-
packet->tx_dest = QED_ROCE_LL2_TX_DEST_NW;
524+
packet->tx_dest = QED_LL2_TX_DEST_NW;
525525

526526
packet->roce_mode = roce_mode;
527527
memcpy(packet->header.vaddr, ud_header_buffer, header_size);

‎include/linux/qed/qed_rdma_if.h‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,6 @@
3939
#include <linux/qed/qed_ll2_if.h>
4040
#include <linux/qed/rdma_common.h>
4141

42-
enum qed_roce_ll2_tx_dest {
43-
/* Light L2 TX Destination to the Network */
44-
QED_ROCE_LL2_TX_DEST_NW,
45-
46-
/* Light L2 TX Destination to the Loopback */
47-
QED_ROCE_LL2_TX_DEST_LB,
48-
QED_ROCE_LL2_TX_DEST_MAX
49-
};
50-
5142
#define QED_RDMA_MAX_CNQ_SIZE (0xFFFF)
5243

5344
/* rdma interface */
@@ -581,7 +572,7 @@ struct qed_roce_ll2_packet {
581572
int n_seg;
582573
struct qed_roce_ll2_buffer payload[RDMA_MAX_SGE_PER_SQ_WQE];
583574
int roce_mode;
584-
enum qed_roce_ll2_tx_dest tx_dest;
575+
enum qed_ll2_tx_dest tx_dest;
585576
};
586577

587578
enum qed_rdma_type {

0 commit comments

Comments
 (0)