Skip to content

Commit

Permalink
RDMA/qedr: Remove enumerated type qed_roce_ll2_tx_dest
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nathan Chancellor authored and Jason Gunthorpe committed Oct 1, 2018
1 parent 935c84a commit aef716f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/qedr/qedr_roce_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ static inline int qedr_gsi_build_packet(struct qedr_dev *dev,
}

if (ether_addr_equal(udh.eth.smac_h, udh.eth.dmac_h))
packet->tx_dest = QED_ROCE_LL2_TX_DEST_LB;
packet->tx_dest = QED_LL2_TX_DEST_LB;
else
packet->tx_dest = QED_ROCE_LL2_TX_DEST_NW;
packet->tx_dest = QED_LL2_TX_DEST_NW;

packet->roce_mode = roce_mode;
memcpy(packet->header.vaddr, ud_header_buffer, header_size);
Expand Down
11 changes: 1 addition & 10 deletions include/linux/qed/qed_rdma_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@
#include <linux/qed/qed_ll2_if.h>
#include <linux/qed/rdma_common.h>

enum qed_roce_ll2_tx_dest {
/* Light L2 TX Destination to the Network */
QED_ROCE_LL2_TX_DEST_NW,

/* Light L2 TX Destination to the Loopback */
QED_ROCE_LL2_TX_DEST_LB,
QED_ROCE_LL2_TX_DEST_MAX
};

#define QED_RDMA_MAX_CNQ_SIZE (0xFFFF)

/* rdma interface */
Expand Down Expand Up @@ -581,7 +572,7 @@ struct qed_roce_ll2_packet {
int n_seg;
struct qed_roce_ll2_buffer payload[RDMA_MAX_SGE_PER_SQ_WQE];
int roce_mode;
enum qed_roce_ll2_tx_dest tx_dest;
enum qed_ll2_tx_dest tx_dest;
};

enum qed_rdma_type {
Expand Down

0 comments on commit aef716f

Please sign in to comment.