Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare()
@ 2020-09-07 13:02 Zhang Changzhong
2020-09-07 13:14 ` Radhey Shyam Pandey
0 siblings, 1 reply; 3+ messages in thread
From: Zhang Changzhong @ 2020-09-07 13:02 UTC (permalink / raw)
To: radhey.shyam.pandey, davem, kuba, michal.simek; +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/xilinx/xilinx_axienet_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index fa5dc299..9aafd3e 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -2038,8 +2038,7 @@ static int axienet_remove(struct platform_device *pdev)
axienet_mdio_teardown(lp);
- if (lp->clk)
- clk_disable_unprepare(lp->clk);
+ clk_disable_unprepare(lp->clk);
of_node_put(lp->phy_node);
lp->phy_node = NULL;
--
2.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare()
2020-09-07 13:02 [PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
@ 2020-09-07 13:14 ` Radhey Shyam Pandey
2020-09-07 20:39 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Radhey Shyam Pandey @ 2020-09-07 13:14 UTC (permalink / raw)
To: Zhang Changzhong, davem, kuba, Michal Simek; +Cc: netdev, linux-kernel
> -----Original Message-----
> From: Zhang Changzhong <zhangchangzhong@huawei.com>
> Sent: Monday, September 7, 2020 6:32 PM
> To: Radhey Shyam Pandey <radheys@xilinx.com>; davem@davemloft.net;
> kuba@kernel.org; Michal Simek <michals@xilinx.com>
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH net-next] net: xilinx: remove redundant null check before
> clk_disable_unprepare()
>
> 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>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Thanks!
> ---
> drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index fa5dc299..9aafd3e 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -2038,8 +2038,7 @@ static int axienet_remove(struct platform_device
> *pdev)
>
> axienet_mdio_teardown(lp);
>
> - if (lp->clk)
> - clk_disable_unprepare(lp->clk);
> + clk_disable_unprepare(lp->clk);
>
> of_node_put(lp->phy_node);
> lp->phy_node = NULL;
> --
> 2.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare()
2020-09-07 13:14 ` Radhey Shyam Pandey
@ 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: Radhey Shyam Pandey
Cc: Zhang Changzhong, davem, Michal Simek, netdev, linux-kernel
On Mon, 7 Sep 2020 13:14:05 +0000 Radhey Shyam Pandey wrote:
> > From: Zhang Changzhong <zhangchangzhong@huawei.com>
> > Sent: Monday, September 7, 2020 6:32 PM
> > To: Radhey Shyam Pandey <radheys@xilinx.com>; davem@davemloft.net;
> > kuba@kernel.org; Michal Simek <michals@xilinx.com>
> > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: [PATCH net-next] net: xilinx: remove redundant null check before
> > clk_disable_unprepare()
> >
> > 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>
>
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.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 13:02 [PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare() Zhang Changzhong
2020-09-07 13:14 ` Radhey Shyam Pandey
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).