2018-09-16 13:26:34

by zhong jiang

[permalink] [raw]
Subject: [PATCH] net: ethernet: remove redundant null pointer check before of_node_put

of_node_put has taken the null pinter check into account. So it is
safe to remove the duplicated check before of_node_put.

Signed-off-by: zhong jiang <[email protected]>
---
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 2708297..67d6c9d 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2055,8 +2055,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)

node = of_get_child_by_name(pdev->dev.of_node, "mdio");
err = of_mdiobus_register(fep->mii_bus, node);
- if (node)
- of_node_put(node);
+ of_node_put(node);
if (err)
goto err_out_free_mdiobus;

--
1.7.12.4



2018-09-16 21:12:14

by Vladimir Zapolskiy

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: remove redundant null pointer check before of_node_put

On 09/16/2018 04:13 PM, zhong jiang wrote:
> of_node_put has taken the null pinter check into account. So it is
> safe to remove the duplicated check before of_node_put.
>
> Signed-off-by: zhong jiang <[email protected]>

typo in the commit message, s/pinter/pointer/

Other than that please feel free to add my

Reviewed-by: Vladimir Zapolskiy <[email protected]>

2018-09-17 01:56:02

by Andy Duan

[permalink] [raw]
Subject: RE: [PATCH] net: ethernet: remove redundant null pointer check before of_node_put

From: zhong jiang <[email protected]> Sent: 2018??9??16?? 21:14
> of_node_put has taken the null pinter check into account. So it is safe to
> remove the duplicated check before of_node_put.
>
> Signed-off-by: zhong jiang <[email protected]>

Acked-by: Fugang Duan <[email protected]>

> ---
> 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 2708297..67d6c9d 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2055,8 +2055,7 @@ static int fec_enet_mii_init(struct
> platform_device *pdev)
>
> node = of_get_child_by_name(pdev->dev.of_node, "mdio");
> err = of_mdiobus_register(fep->mii_bus, node);
> - if (node)
> - of_node_put(node);
> + of_node_put(node);
> if (err)
> goto err_out_free_mdiobus;
>
> --
> 1.7.12.4

2018-09-17 15:22:37

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: remove redundant null pointer check before of_node_put

From: zhong jiang <[email protected]>
Date: Sun, 16 Sep 2018 21:13:42 +0800

> of_node_put has taken the null pinter check into account. So it is
> safe to remove the duplicated check before of_node_put.
>
> Signed-off-by: zhong jiang <[email protected]>

Applied.