* Clarification on dead code in init_send_sqe_rc Function
@ 2024-12-19 4:20 Dheeraj Reddy Jonnalagadda
0 siblings, 0 replies; only message in thread
From: Dheeraj Reddy Jonnalagadda @ 2024-12-19 4:20 UTC (permalink / raw)
To: chengyou, kaishen; +Cc: jgg, leon, linux-rdma, linux-kernel
Dear Maintainers,
While analyzing the init_send_sqe_rc function in the erdma driver, specifically
in the erdma_qp.c file, I noticed a static analysis issue flagged by Coverity
(CID 1602610) regarding a dead code block.
Link to Coverity issue:
https://scan7.scan.coverity.com/#/project-view/52337/11354?selectedIssue=1602610
In the function, the variable op is initialized to ERDMA_OP_SEND as follows:
--> u32 op = ERDMA_OP_SEND;
The conditional block shown below is unreachable because op is never assigned
the value IB_WR_SEND_WITH_INV after its initialization. The condition will
always evaluate to false, rendering this block of code dead.
--> } else if (op == IB_WR_SEND_WITH_INV) {
--> op = ERDMA_OP_SEND_WITH_INV;
--> sqe->invalid_stag = cpu_to_le32(wr->ex.invalidate_rkey);
--> }
I wanted to ask for clarification regarding the intended behavior:
1. Should there be an additional condition in wr->opcode to set op to
IB_WR_SEND_WITH_INV before this block is checked?
2. If this block is unnecessary, should it be removed to clean up the
code?
If the logic requires changes, I would be happy to submit a patch to address
this issue. Please let me know your thoughts on how best to proceed.
Thank you for your time.
-Dheeraj
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-19 4:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 4:20 Clarification on dead code in init_send_sqe_rc Function Dheeraj Reddy Jonnalagadda
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.