Blob Blame History Raw
From: Peng Li <lipeng321@huawei.com>
Date: Fri, 27 Aug 2021 17:28:21 +0800
Subject: net: hns3: remove redundant param to simplify code
Patch-mainline: v5.15-rc1
Git-commit: 5f22a80f32deed391011f7ab3ce8951ea89282f8
References: bsc#1190336

The param msg_q is redundant, copy &req->msg to
hdev->arq.msg_q[hdev->arq.tail] directly makes code clean.
So removes the redundant param msg_q.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
@@ -161,7 +161,6 @@ void hclgevf_mbx_handler(struct hclgevf_
 	struct hclge_mbx_pf_to_vf_cmd *req;
 	struct hclgevf_cmq_ring *crq;
 	struct hclgevf_desc *desc;
-	u16 *msg_q;
 	u16 flag;
 
 	resp = &hdev->mbx_resp;
@@ -243,8 +242,7 @@ void hclgevf_mbx_handler(struct hclgevf_
 			}
 
 			/* tail the async message in arq */
-			msg_q = hdev->arq.msg_q[hdev->arq.tail];
-			memcpy(&msg_q[0], &req->msg,
+			memcpy(hdev->arq.msg_q[hdev->arq.tail], &req->msg,
 			       HCLGE_MBX_MAX_ARQ_MSG_SIZE * sizeof(u16));
 			hclge_mbx_tail_ptr_move_arq(hdev->arq);
 			atomic_inc(&hdev->arq.count);