linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare()
@ 2020-09-07 12:49 Zhang Changzhong
  2020-09-07 13:14 ` Andy Duan
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Changzhong @ 2020-09-07 12:49 UTC (permalink / raw)
  To: fugang.duan, davem, kuba; +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/freescale/fec_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fb37816..c043afb 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1960,8 +1960,7 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
 		mutex_unlock(&fep->ptp_clk_mutex);
 	}
 failed_clk_ptp:
-	if (fep->clk_enet_out)
-		clk_disable_unprepare(fep->clk_enet_out);
+	clk_disable_unprepare(fep->clk_enet_out);
 
 	return ret;
 }
-- 
2.9.5


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

* RE: [PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare()
  2020-09-07 12:49 [PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
@ 2020-09-07 13:14 ` Andy Duan
  2020-09-07 20:39   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Duan @ 2020-09-07 13:14 UTC (permalink / raw)
  To: Zhang Changzhong, davem, kuba; +Cc: netdev, linux-kernel

From: Zhang Changzhong <zhangchangzhong@huawei.com> Sent: Monday, September 7, 2020 8:50 PM
> 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>

Acked-by: Fugang Duan <fugang.duan@nxp.com>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index fb37816..c043afb 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1960,8 +1960,7 @@ static int fec_enet_clk_enable(struct net_device
> *ndev, bool enable)
>  		mutex_unlock(&fep->ptp_clk_mutex);
>  	}
>  failed_clk_ptp:
> -	if (fep->clk_enet_out)
> -		clk_disable_unprepare(fep->clk_enet_out);
> +	clk_disable_unprepare(fep->clk_enet_out);
> 
>  	return ret;
>  }
> --
> 2.9.5


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

* Re: [PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare()
  2020-09-07 13:14 ` Andy Duan
@ 2020-09-07 20:39   ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-09-07 20:39 UTC (permalink / raw)
  To: Andy Duan; +Cc: Zhang Changzhong, davem, netdev, linux-kernel

On Mon, 7 Sep 2020 13:14:50 +0000 Andy Duan wrote:
> From: Zhang Changzhong <zhangchangzhong@huawei.com> Sent: Monday, September 7, 2020 8:50 PM
> > 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>  
> 
> Acked-by: Fugang Duan <fugang.duan@nxp.com>

Applied, thanks!

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

end of thread, other threads:[~2020-09-07 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 12:49 [PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
2020-09-07 13:14 ` Andy Duan
2020-09-07 20:39   ` Jakub Kicinski

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).