* [PATCH net-next] net: encx24j600: make encx24j600_hw_init() return void
@ 2020-05-07 11:09 Jason Yan
2020-05-07 20:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-05-07 11:09 UTC (permalink / raw)
To: davem, yanaijie, netdev, linux-kernel
This function always return 0 now, we can make it return void to
simplify the code. This fixes the following coccicheck warning:
drivers/net/ethernet/microchip/encx24j600.c:609:5-8: Unneeded variable:
"ret". Return "0" on line 653
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/net/ethernet/microchip/encx24j600.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
index 39925e4bf2ec..fccc4805247f 100644
--- a/drivers/net/ethernet/microchip/encx24j600.c
+++ b/drivers/net/ethernet/microchip/encx24j600.c
@@ -604,9 +604,8 @@ static void encx24j600_set_rxfilter_mode(struct encx24j600_priv *priv)
}
}
-static int encx24j600_hw_init(struct encx24j600_priv *priv)
+static void encx24j600_hw_init(struct encx24j600_priv *priv)
{
- int ret = 0;
u16 macon2;
priv->hw_enabled = false;
@@ -649,8 +648,6 @@ static int encx24j600_hw_init(struct encx24j600_priv *priv)
if (netif_msg_hw(priv))
encx24j600_dump_config(priv, "Hw is initialized");
-
- return ret;
}
static void encx24j600_hw_enable(struct encx24j600_priv *priv)
@@ -1042,12 +1039,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)
}
/* Initialize the device HW to the consistent state */
- if (encx24j600_hw_init(priv)) {
- netif_err(priv, probe, ndev,
- DRV_NAME ": HW initialization error\n");
- ret = -EIO;
- goto out_free;
- }
+ encx24j600_hw_init(priv);
kthread_init_worker(&priv->kworker);
kthread_init_work(&priv->tx_work, encx24j600_tx_proc);
--
2.21.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: encx24j600: make encx24j600_hw_init() return void
2020-05-07 11:09 [PATCH net-next] net: encx24j600: make encx24j600_hw_init() return void Jason Yan
@ 2020-05-07 20:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-07 20:04 UTC (permalink / raw)
To: yanaijie; +Cc: netdev, linux-kernel
From: Jason Yan <yanaijie@huawei.com>
Date: Thu, 7 May 2020 19:09:05 +0800
> This function always return 0 now, we can make it return void to
> simplify the code. This fixes the following coccicheck warning:
>
> drivers/net/ethernet/microchip/encx24j600.c:609:5-8: Unneeded variable:
> "ret". Return "0" on line 653
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-07 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 11:09 [PATCH net-next] net: encx24j600: make encx24j600_hw_init() return void Jason Yan
2020-05-07 20:04 ` 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).