Skip to contentSkip to conversation

RDMA/rxe: Remove the unnecessary variable

PATCH Applied [email protected] 2 participants 2 messages Dec 7, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/rxe: Remove the unnecessary variable

From: Zhu Yanjun <[email protected]>

The variable pkey is assigned to a macro. Then this variable is passed to a function bth_init directly. And pkey is not used again. So remove it and use the macro directly.

Fixes 76251e15ea73 ("RDMA/rxe: Remove pkey table")
---
 drivers/infiniband/sw/rxe/rxe_req.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/infiniband/sw/rxe/rxe_req.c +1 -4
index 0c9d2af15f3d..350c47174aca 100644
@@ -372,7 +372,6 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
 	int			pad = (-payload) & 0x3;
 	int			paylen;
 	int			solicited;
-	u16			pkey;
 	u32			qp_num;
 	int			ack_req;
 
@@ -404,8 +403,6 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
 			(pkt->mask & (RXE_WRITE_MASK | RXE_IMMDT_MASK)) ==
 			(RXE_WRITE_MASK | RXE_IMMDT_MASK));
 
-	pkey = IB_DEFAULT_PKEY_FULL;
-
 	qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn :
 					 qp->attr.dest_qp_num;
 
@@ -414,7 +411,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
 	if (ack_req)
 		qp->req.noack_pkts = 0;
 
-	bth_init(pkt, pkt->opcode, solicited, 0, pad, pkey, qp_num,
+	bth_init(pkt, pkt->opcode, solicited, 0, pad, IB_DEFAULT_PKEY_FULL, qp_num,
 		 ack_req, pkt->psn);
 
 	/* init optional headers */
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 11 lines · On Tue, Dec 07, 2021 at 02:40:57PM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The variable pkey is assigned to a macro. Then this variable is passed to a function bth_init directly. And pkey is not used again. So remove it and use the macro directly.

Fixes 76251e15ea73 ("RDMA/rxe: Remove pkey table")
---
 drivers/infiniband/sw/rxe/rxe_req.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Applied to for-next, thanks

Jason