RDMA/erdma: Fix opcode conditional check
Subsystems (2)
Fix conditional if else check by checking with wr->opcode. The indicated dead code may have performed some action; that action will never occur as op is pre-assigned a different value.
Signed-off-by Advait Dhamorikar <[email protected]>
--- drivers/infiniband/hw/erdma/erdma_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/erdma/erdma_qp.c +1 -1
@@ -406,7 +406,7 @@ static void init_send_sqe_rc(struct erdma_qp *qp, struct erdma_send_sqe_rc *sqe,if (wr->opcode ==IB_WR_SEND_WITH_IMM ) { op =ERDMA_OP_SEND_WITH_IMM ; sqe->imm_data = wr->ex.imm_data; - }else if (op ==IB_WR_SEND_WITH_INV ) { + }else if (wr->opcode ==IB_WR_SEND_WITH_INV ) { op =ERDMA_OP_SEND_WITH_INV ; sqe->invalid_stag =cpu_to_le32 (wr->ex.invalidate_rkey); }
Signature · 1 line
2.34.1
Quoted 9 lines · Advait Dhamorikar
Fix conditional if else check by checking with
wr->opcode. The indicated dead code may have performed some action; that action will never occur as op is pre-assigned a different value.Signed-off-by Advait Dhamorikar <[email protected]>--- drivers/infiniband/hw/erdma/erdma_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Cheng Xu <[email protected]>
Thanks very much,
Cheng Xu
Quoted 13 lines
drivers/infiniband/hw/erdma/erdma_qp.c +1
-1@@ -406,7 +406,7 @@ static void init_send_sqe_rc(struct erdma_qp *qp, struct erdma_send_sqe_rc *sqe,if (wr->opcode ==IB_WR_SEND_WITH_IMM ) { op =ERDMA_OP_SEND_WITH_IMM ; sqe->imm_data = wr->ex.imm_data; - }else if (op ==IB_WR_SEND_WITH_INV ) { + }else if (wr->opcode ==IB_WR_SEND_WITH_INV ) { op =ERDMA_OP_SEND_WITH_INV ; sqe->invalid_stag =cpu_to_le32 (wr->ex.invalidate_rkey); }
Leon Romanovsky
AppliedQuoted 5 lines · Advait Dhamorikar
Fix conditional if else check by checking with
wr->opcode. The indicated dead code may have performed some action; that action will never occur as op is pre-assigned a different value.
Applied, thanks!
[1/1] RDMA/erdma: Fix opcode conditional check
https://git.kernel.org/rdma/rdma/c/c57c76498a895a
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>