netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: dwmac-intel-plat: remove redundant null check before clk_disable_unprepare()
@ 2020-09-09 14:09 Zhang Changzhong
  2020-09-09 21:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Changzhong @ 2020-09-09 14:09 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
	mcoquelin.stm32
  Cc: netdev, linux-kernel

Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
index ccac7bf..b1323d5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
@@ -149,9 +149,7 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
 
 	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
 	if (ret) {
-		if (dwmac->tx_clk)
-			clk_disable_unprepare(dwmac->tx_clk);
-
+		clk_disable_unprepare(dwmac->tx_clk);
 		goto err_remove_config_dt;
 	}
 
@@ -169,9 +167,7 @@ static int intel_eth_plat_remove(struct platform_device *pdev)
 	int ret;
 
 	ret = stmmac_pltfr_remove(pdev);
-
-	if (dwmac->tx_clk)
-		clk_disable_unprepare(dwmac->tx_clk);
+	clk_disable_unprepare(dwmac->tx_clk);
 
 	return ret;
 }
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: stmmac: dwmac-intel-plat: remove redundant null check before clk_disable_unprepare()
  2020-09-09 14:09 [PATCH net-next] net: stmmac: dwmac-intel-plat: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
@ 2020-09-09 21:18 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-09 21:18 UTC (permalink / raw)
  To: zhangchangzhong
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, kuba, mcoquelin.stm32,
	netdev, linux-kernel

From: Zhang Changzhong <zhangchangzhong@huawei.com>
Date: Wed, 9 Sep 2020 22:09:00 +0800

> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-09 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-09 14:09 [PATCH net-next] net: stmmac: dwmac-intel-plat: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
2020-09-09 21:18 ` 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).