[cocci] [PATCH 21/36] RDMA/ocrdma: remove conditional return with no effect
Sang-Heon Jeon <[email protected]> Fri, 24 Jul 2026 03:45:23 +0900
| Newsgroups | fr.inria.cocci,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rdma |
|---|---|
| Message-ID | <[email protected]> |
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly. This is the result of running the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci. Signed-off-by: Sang-Heon Jeon <[email protected]> --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index cfe3d19b73b3..017b3660173e 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -1749,11 +1749,8 @@ static int ocrdma_copy_srq_uresp(struct ocrdma_dev *dev, struct ocrdma_srq *srq, status = ib_respond_udata(udata, uresp); if (status) return status; - status = ocrdma_add_mmap(srq->pd->uctx, uresp.rq_page_addr[0], - uresp.rq_page_size); - if (status) - return status; - return status; + return ocrdma_add_mmap(srq->pd->uctx, uresp.rq_page_addr[0], + uresp.rq_page_size); } int ocrdma_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init_attr, -- 2.43.0