Skip to contentSkip to conversation

net: hns3: remove redundant initialization of pointer 'client'

PATCH Applied Colin King 2 participants 2 messages Feb 24, 2020

Subsystems (5)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH v2 1/1 net: hns3: remove redundant initialization of pointer 'client'

From: Colin Ian King <[email protected]>

The pointer 'client' is being initialized with a value that is never read, it is being updated later on. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---

V2: use reverse christmas tree ordering of local variables

---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +1 -1
index 51399dbed77a..89d352385260 100644
@@ -9076,8 +9076,8 @@ static int hclge_init_nic_client_instance(struct hnae3_ae_dev *ae_dev,
 static int hclge_init_roce_client_instance(struct hnae3_ae_dev *ae_dev,
 					   struct hclge_vport *vport)
 {
-	struct hnae3_client *client = vport->roce.client;
 	struct hclge_dev *hdev = ae_dev->priv;
+	struct hnae3_client *client;
 	int rst_cnt;
 	int ret;
 
Signature · 1 line
2.25.0
maintainer Applied
#1 lore raw

From: Colin King <[email protected]>
Date: Mon, 24 Feb 2020 19:20:22 +0000

Quoted 11 lines

From: Colin Ian King <[email protected]>

The pointer 'client' is being initialized with a value that is never read, it is being updated later on. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---

V2: use reverse christmas tree ordering of local variables

Applied to net-next, thanks Colin.