* [PATCH] net: hns3: remove redundant initialization of pointer 'client'
@ 2020-02-22 19:52 Colin King
2020-02-24 1:27 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-02-22 19:52 UTC (permalink / raw)
To: Yisen Zhuang, Salil Mehta, David S . Miller, Huazhong Tan, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 51399dbed77a..a121af513704 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -9076,7 +9076,7 @@ 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 hnae3_client *client;
struct hclge_dev *hdev = ae_dev->priv;
int rst_cnt;
int ret;
--
2.25.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: hns3: remove redundant initialization of pointer 'client'
2020-02-22 19:52 [PATCH] net: hns3: remove redundant initialization of pointer 'client' Colin King
@ 2020-02-24 1:27 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-02-24 1:27 UTC (permalink / raw)
To: colin.king
Cc: yisen.zhuang, salil.mehta, tanhuazhong, netdev, kernel-janitors,
linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Sat, 22 Feb 2020 19:52:31 +0000
> @@ -9076,7 +9076,7 @@ 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 hnae3_client *client;
> struct hclge_dev *hdev = ae_dev->priv;
> int rst_cnt;
> int ret;
Please preserve the reverse christmas tree ordering of local variables when
you make changes like this.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-24 1:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-22 19:52 [PATCH] net: hns3: remove redundant initialization of pointer 'client' Colin King
2020-02-24 1:27 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).