diff mbox series

[for-next,v4] RDMA/ocrdma: remove unneeded variable

Message ID 20211214092339.438350-1-chi.minghao@zte.com.cn (mailing list archive)
State Superseded
Delegated to: Jason Gunthorpe
Headers show
Series [for-next,v4] RDMA/ocrdma: remove unneeded variable | expand

Commit Message

CGEL Dec. 14, 2021, 9:23 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Return status directly from function called.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
change since v2: [PATCHv2] drivers:ocrdma:remove unneeded variable
             v3: [PATCH v3 ocrdma-next] drivers: ocrdma: remove unneeded
variable
             v4: [PATCH for-next v4] RDMA/ocrdma: remove unneeded
variable
Thanks!
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

 int ocrdma_destroy_srq(struct ib_srq *ibsrq, struct ib_udata *udata)
@@ -1960,7 +1958,6 @@ static int ocrdma_build_inline_sges(struct
ocrdma_qp *qp,
 static int ocrdma_build_send(struct ocrdma_qp *qp, struct
ocrdma_hdr_wqe *hdr,
 			     const struct ib_send_wr *wr)
 {
-	int status;
 	struct ocrdma_sge *sge;
 	u32 wqe_size = sizeof(*hdr);
 
@@ -1972,8 +1969,7 @@ static int ocrdma_build_send(struct ocrdma_qp *qp,
struct ocrdma_hdr_wqe *hdr,
 		sge = (struct ocrdma_sge *)(hdr + 1);
 	}
 
-	status = ocrdma_build_inline_sges(qp, hdr, sge, wr, wqe_size);
-	return status;
+	return ocrdma_build_inline_sges(qp, hdr, sge, wr, wqe_size);
 }
 
 static int ocrdma_build_write(struct ocrdma_qp *qp, struct
ocrdma_hdr_wqe *hdr,

Comments

Devesh Sharma Dec. 14, 2021, 11:12 a.m. UTC | #1
> -----Original Message-----
> From: cgel.zte@gmail.com <cgel.zte@gmail.com>
> Sent: Tuesday, December 14, 2021 2:54 PM
> To: Devesh Sharma <devesh.s.sharma@oracle.com>
> Cc: cgel.zte@gmail.com; chi.minghao@zte.com.cn;
> dennis.dalessandro@cornelisnetworks.com; dledford@redhat.com;
> jgg@ziepe.ca; leon@kernel.org; linux-kernel@vger.kernel.org; linux-
> rdma@vger.kernel.org; mbloch@nvidia.com; selvin.xavier@broadcom.com;
> trix@redhat.com; Zeal Robot <zealci@zte.com.cn>
> Subject: [External] : [PATCH for-next v4] RDMA/ocrdma: remove unneeded
> variable
> 
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return status directly from function called.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
> change since v2: [PATCHv2] drivers:ocrdma:remove unneeded variable
>              v3: [PATCH v3 ocrdma-next] drivers: ocrdma: remove unneeded
> variable
>              v4: [PATCH for-next v4] RDMA/ocrdma: remove unneeded variable
> Thanks!
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> index 735123d0e9ec..3bfbf4ec040d 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> @@ -1844,12 +1844,10 @@ int ocrdma_modify_srq(struct ib_srq *ibsrq,
> 
>  int ocrdma_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr
> *srq_attr)
>  {
> -	int status;
>  	struct ocrdma_srq *srq;
> 
>  	srq = get_ocrdma_srq(ibsrq);
> -	status = ocrdma_mbx_query_srq(srq, srq_attr);
> -	return status;
> +	return ocrdma_mbx_query_srq(srq, srq_attr);
>  }
> 
>  int ocrdma_destroy_srq(struct ib_srq *ibsrq, struct ib_udata *udata) @@ -
> 1960,7 +1958,6 @@ static int ocrdma_build_inline_sges(struct ocrdma_qp
> *qp,  static int ocrdma_build_send(struct ocrdma_qp *qp, struct
> ocrdma_hdr_wqe *hdr,
>  			     const struct ib_send_wr *wr)
>  {
> -	int status;
>  	struct ocrdma_sge *sge;
>  	u32 wqe_size = sizeof(*hdr);
> 
> @@ -1972,8 +1969,7 @@ static int ocrdma_build_send(struct ocrdma_qp
> *qp, struct ocrdma_hdr_wqe *hdr,
>  		sge = (struct ocrdma_sge *)(hdr + 1);
>  	}
> 
> -	status = ocrdma_build_inline_sges(qp, hdr, sge, wr, wqe_size);
> -	return status;
> +	return ocrdma_build_inline_sges(qp, hdr, sge, wr, wqe_size);
>  }
> 
>  static int ocrdma_build_write(struct ocrdma_qp *qp, struct
> ocrdma_hdr_wqe *hdr,
LGTM
Reviewed-by: Devesh Sharma <devesh.s.sharma@oracle.com>
> --
> 2.25.1
Jason Gunthorpe Dec. 14, 2021, 11:50 p.m. UTC | #2
On Tue, Dec 14, 2021 at 09:23:39AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return status directly from function called.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
> change since v2: [PATCHv2] drivers:ocrdma:remove unneeded variable
>              v3: [PATCH v3 ocrdma-next] drivers: ocrdma: remove unneeded
> variable
>              v4: [PATCH for-next v4] RDMA/ocrdma: remove unneeded
> variable
> Thanks!
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

This is white space mangled and won't apply, please fix your
environment.

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 735123d0e9ec..3bfbf4ec040d 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -1844,12 +1844,10 @@  int ocrdma_modify_srq(struct ib_srq *ibsrq,
 
 int ocrdma_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr
*srq_attr)
 {
-	int status;
 	struct ocrdma_srq *srq;
 
 	srq = get_ocrdma_srq(ibsrq);
-	status = ocrdma_mbx_query_srq(srq, srq_attr);
-	return status;
+	return ocrdma_mbx_query_srq(srq, srq_attr);
 }