[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Z2OfDPDPbpclUoaa@HOME-PC>
Date: Thu, 19 Dec 2024 09:50:28 +0530
From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@...il.com>
To: chengyou@...ux.alibaba.com, kaishen@...ux.alibaba.com
Cc: jgg@...pe.ca, leon@...nel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Clarification on dead code in init_send_sqe_rc Function
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
Powered by blists - more mailing lists