linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/qedr: Explicitly cast pkt->tx_dest to qed_ll2_tx_dest
@ 2018-09-27  1:18 Nathan Chancellor
  2018-09-27 20:28 ` Nick Desaulniers
  2018-09-27 20:55 ` [PATCH v2] RDMA/qedr: Remove enumerated type qed_roce_ll2_tx_dest Nathan Chancellor
  0 siblings, 2 replies; 8+ messages in thread
From: Nathan Chancellor @ 2018-09-27  1:18 UTC (permalink / raw)
  To: Michal Kalderon, Ariel Elior, Doug Ledford, Jason Gunthorpe
  Cc: linux-rdma, linux-kernel, Nick Desaulniers, Nathan Chancellor

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.

Avoid this warning by explicitly casting pkt->tx_dest to
qed_112_tx_dest, which has the expected values from the
type qed_roce_ll2_tx_dest.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/infiniband/hw/qedr/qedr_roce_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/qedr/qedr_roce_cm.c b/drivers/infiniband/hw/qedr/qedr_roce_cm.c
index 85578887421b..147e0d69003d 100644
--- a/drivers/infiniband/hw/qedr/qedr_roce_cm.c
+++ b/drivers/infiniband/hw/qedr/qedr_roce_cm.c
@@ -195,7 +195,7 @@ static int qedr_ll2_post_tx(struct qedr_dev *dev,
 
 	ll2_tx_pkt.num_of_bds = 1 /* hdr */  + pkt->n_seg;
 	ll2_tx_pkt.vlan = 0;
-	ll2_tx_pkt.tx_dest = pkt->tx_dest;
+	ll2_tx_pkt.tx_dest = (enum qed_ll2_tx_dest)pkt->tx_dest;
 	ll2_tx_pkt.qed_roce_flavor = roce_flavor;
 	ll2_tx_pkt.first_frag = pkt->header.baddr;
 	ll2_tx_pkt.first_frag_len = pkt->header.len;
-- 
2.19.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-09-28 16:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-27  1:18 [PATCH] RDMA/qedr: Explicitly cast pkt->tx_dest to qed_ll2_tx_dest Nathan Chancellor
2018-09-27 20:28 ` Nick Desaulniers
2018-09-27 20:35   ` Nathan Chancellor
2018-09-27 20:41     ` Nick Desaulniers
2018-09-27 20:55 ` [PATCH v2] RDMA/qedr: Remove enumerated type qed_roce_ll2_tx_dest Nathan Chancellor
2018-09-27 22:29   ` Nick Desaulniers
2018-09-28  8:06     ` Kalderon, Michal
2018-09-28 16:14   ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).