diff mbox series

[v2,5/7] IB/hfi1: Remove set-but-not-used variables

Message ID 20190327235051.67361-6-bvanassche@acm.org (mailing list archive)
State Rejected
Headers show
Series Multiple fixes for issues reported by static checkers | expand

Commit Message

Bart Van Assche March 27, 2019, 11:50 p.m. UTC
This patch avoids that compiler warnings are reported when building with W=1.

Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/hw/hfi1/tid_rdma.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Wan, Kaike March 28, 2019, 11:50 a.m. UTC | #1
This patch will conflict with the following two patches submit earlier:

(1) Patch 1

https://patchwork.kernel.org/patch/10858139/

[for-next,3/4] IB/hfi1: Unify the software PSN check for TID RDMA READ/WRITE

(2) Patch 2

https://patchwork.kernel.org/patch/10858445/

[for-next] IB/hfi1: Implement CCA for TID RDMA protocol

Kaike

> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Bart Van Assche
> Sent: Wednesday, March 27, 2019 7:51 PM
> To: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Leon Romanovsky <leonro@mellanox.com>; Doug Ledford
> <dledford@redhat.com>; linux-rdma@vger.kernel.org; Bart Van Assche
> <bvanassche@acm.org>; Marciniszyn, Mike <mike.marciniszyn@intel.com>;
> Dalessandro, Dennis <dennis.dalessandro@intel.com>
> Subject: [PATCH v2 5/7] IB/hfi1: Remove set-but-not-used variables
> 
> This patch avoids that compiler warnings are reported when building with
> W=1.
> 
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/infiniband/hw/hfi1/tid_rdma.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c
> b/drivers/infiniband/hw/hfi1/tid_rdma.c
> index fdda33aca77f..93f1762a20cd 100644
> --- a/drivers/infiniband/hw/hfi1/tid_rdma.c
> +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c
> @@ -2019,7 +2019,6 @@ static int tid_rdma_rcv_error(struct hfi1_packet
> *packet,
>  	trace_hfi1_tid_req_rcv_err(qp, 0, e->opcode, e->psn, e->lpsn, req);
>  	if (e->opcode == TID_OP(READ_REQ)) {
>  		struct ib_reth *reth;
> -		u32 offset;
>  		u32 len;
>  		u32 rkey;
>  		u64 vaddr;
> @@ -2031,7 +2030,6 @@ static int tid_rdma_rcv_error(struct hfi1_packet
> *packet,
>  		 * The requester always restarts from the start of the original
>  		 * request.
>  		 */
> -		offset = delta_psn(psn, e->psn) * qp->pmtu;
>  		len = be32_to_cpu(reth->length);
>  		if (psn != e->psn || len != req->total_len)
>  			goto unlock;
> @@ -2465,11 +2463,10 @@ void hfi1_rc_rcv_tid_rdma_read_resp(struct
> hfi1_packet *packet)
>  	u32 opcode, aeth;
>  	bool is_fecn;
>  	unsigned long flags;
> -	u32 kpsn, ipsn;
> +	u32 ipsn;

[Wan, Kaike]  kpsn is used in Patch 1.

> 
>  	trace_hfi1_sender_rcv_tid_read_resp(qp);
>  	is_fecn = process_ecn(qp, packet);
> -	kpsn = mask_psn(be32_to_cpu(ohdr->bth[2]));
>  	aeth = be32_to_cpu(ohdr->u.tid_rdma.r_rsp.aeth);
>  	opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0xff;
> 
> @@ -4486,13 +4483,12 @@ void hfi1_rc_rcv_tid_rdma_ack(struct
> hfi1_packet *packet)
>  	struct rvt_swqe *wqe;
>  	struct tid_rdma_request *req;
>  	struct tid_rdma_flow *flow;
> -	u32 aeth, psn, req_psn, ack_psn, fspsn, resync_psn, ack_kpsn;
> -	bool is_fecn;
> +	u32 aeth, psn, req_psn, ack_psn, resync_psn, ack_kpsn;

[Wan, Kaike]  is_fecn is renamed as "fecn" and used in Patch 2.

>  	unsigned long flags;
>  	u16 fidx;
> 
>  	trace_hfi1_tid_write_sender_rcv_tid_ack(qp, 0);
> -	is_fecn = process_ecn(qp, packet);
> +	process_ecn(qp, packet);
>  	psn = mask_psn(be32_to_cpu(ohdr->bth[2]));
>  	aeth = be32_to_cpu(ohdr->u.tid_rdma.ack.aeth);
>  	req_psn = mask_psn(be32_to_cpu(ohdr-
> >u.tid_rdma.ack.verbs_psn));
> @@ -4691,7 +4687,7 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet
> *packet)
>  			IB_AETH_CREDIT_MASK) {
>  		case 0: /* PSN sequence error */
>  			flow = &req->flows[req->acked_tail];
> -			fspsn = full_flow_psn(flow, flow->flow_state.spsn);
> +			full_flow_psn(flow, flow->flow_state.spsn);

 [Wan, Kaike]  Just remove the entire line: full_flow_psn() just returns the full flow psn without any side effects.

>  			trace_hfi1_tid_flow_rcv_tid_ack(qp, req->acked_tail,
>  							flow);
>  			req->r_ack_psn = mask_psn(be32_to_cpu(ohdr-
> >bth[2]));
> @@ -4846,10 +4842,9 @@ void hfi1_rc_rcv_tid_rdma_resync(struct
> hfi1_packet *packet)
>  	struct tid_rdma_flow *flow;
>  	struct tid_flow_state *fs = &qpriv->flow_state;
>  	u32 psn, generation, idx, gen_next;
> -	bool is_fecn;
[Wan, Kaike]  It is renamed as "fecn" and used in Patch 2.

>  	unsigned long flags;
> 
> -	is_fecn = process_ecn(qp, packet);
> +	process_ecn(qp, packet);
>  	psn = mask_psn(be32_to_cpu(ohdr->bth[2]));
> 
>  	generation = mask_psn(psn + 1) >> HFI1_KDETH_BTH_SEQ_SHIFT;
> --
> 2.21.0.196.g041f5ea1cf98
Bart Van Assche March 28, 2019, 1:52 p.m. UTC | #2
On 3/28/19 4:50 AM, Wan, Kaike wrote:
> This patch will conflict with the following two patches submit earlier:
> 
> (1) Patch 1
> 
> https://patchwork.kernel.org/patch/10858139/
> 
> [for-next,3/4] IB/hfi1: Unify the software PSN check for TID RDMA READ/WRITE
> 
> (2) Patch 2
> 
> https://patchwork.kernel.org/patch/10858445/
> 
> [for-next] IB/hfi1: Implement CCA for TID RDMA protocol

Hi Kaike,

I will drop this patch.

Bart.
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c
index fdda33aca77f..93f1762a20cd 100644
--- a/drivers/infiniband/hw/hfi1/tid_rdma.c
+++ b/drivers/infiniband/hw/hfi1/tid_rdma.c
@@ -2019,7 +2019,6 @@  static int tid_rdma_rcv_error(struct hfi1_packet *packet,
 	trace_hfi1_tid_req_rcv_err(qp, 0, e->opcode, e->psn, e->lpsn, req);
 	if (e->opcode == TID_OP(READ_REQ)) {
 		struct ib_reth *reth;
-		u32 offset;
 		u32 len;
 		u32 rkey;
 		u64 vaddr;
@@ -2031,7 +2030,6 @@  static int tid_rdma_rcv_error(struct hfi1_packet *packet,
 		 * The requester always restarts from the start of the original
 		 * request.
 		 */
-		offset = delta_psn(psn, e->psn) * qp->pmtu;
 		len = be32_to_cpu(reth->length);
 		if (psn != e->psn || len != req->total_len)
 			goto unlock;
@@ -2465,11 +2463,10 @@  void hfi1_rc_rcv_tid_rdma_read_resp(struct hfi1_packet *packet)
 	u32 opcode, aeth;
 	bool is_fecn;
 	unsigned long flags;
-	u32 kpsn, ipsn;
+	u32 ipsn;
 
 	trace_hfi1_sender_rcv_tid_read_resp(qp);
 	is_fecn = process_ecn(qp, packet);
-	kpsn = mask_psn(be32_to_cpu(ohdr->bth[2]));
 	aeth = be32_to_cpu(ohdr->u.tid_rdma.r_rsp.aeth);
 	opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0xff;
 
@@ -4486,13 +4483,12 @@  void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet)
 	struct rvt_swqe *wqe;
 	struct tid_rdma_request *req;
 	struct tid_rdma_flow *flow;
-	u32 aeth, psn, req_psn, ack_psn, fspsn, resync_psn, ack_kpsn;
-	bool is_fecn;
+	u32 aeth, psn, req_psn, ack_psn, resync_psn, ack_kpsn;
 	unsigned long flags;
 	u16 fidx;
 
 	trace_hfi1_tid_write_sender_rcv_tid_ack(qp, 0);
-	is_fecn = process_ecn(qp, packet);
+	process_ecn(qp, packet);
 	psn = mask_psn(be32_to_cpu(ohdr->bth[2]));
 	aeth = be32_to_cpu(ohdr->u.tid_rdma.ack.aeth);
 	req_psn = mask_psn(be32_to_cpu(ohdr->u.tid_rdma.ack.verbs_psn));
@@ -4691,7 +4687,7 @@  void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet)
 			IB_AETH_CREDIT_MASK) {
 		case 0: /* PSN sequence error */
 			flow = &req->flows[req->acked_tail];
-			fspsn = full_flow_psn(flow, flow->flow_state.spsn);
+			full_flow_psn(flow, flow->flow_state.spsn);
 			trace_hfi1_tid_flow_rcv_tid_ack(qp, req->acked_tail,
 							flow);
 			req->r_ack_psn = mask_psn(be32_to_cpu(ohdr->bth[2]));
@@ -4846,10 +4842,9 @@  void hfi1_rc_rcv_tid_rdma_resync(struct hfi1_packet *packet)
 	struct tid_rdma_flow *flow;
 	struct tid_flow_state *fs = &qpriv->flow_state;
 	u32 psn, generation, idx, gen_next;
-	bool is_fecn;
 	unsigned long flags;
 
-	is_fecn = process_ecn(qp, packet);
+	process_ecn(qp, packet);
 	psn = mask_psn(be32_to_cpu(ohdr->bth[2]));
 
 	generation = mask_psn(psn + 1) >> HFI1_KDETH_BTH_SEQ_SHIFT;