Skip to contentSkip to conversation

eth: dpaa2-mac: remove a dead-code NULL check on fwnode parent

PATCH Applied Jakub Kicinski 2 participants 2 messages May 6, 2022 – May 10, 2022

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 eth: dpaa2-mac: remove a dead-code NULL check on fwnode parent

Since commit 4e30e98c4b4c ("dpaa2-mac: return -EPROBE_DEFER from dpaa2_mac_open in case the fwnode is not set") @parent can't be NULL after the if. It's either the address
of the ->fwnode of @dpmacs or @fwnode in case of ACPI.

---
Right, Ioana? Let's clean this up so the of_node_put() bots go away.

---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +0 -3
index c48811d3bcd5..c9bee9a0c9b2 100644
@@ -108,9 +108,6 @@ static struct fwnode_handle *dpaa2_mac_get_node(struct device *dev,
 		return ERR_PTR(-EPROBE_DEFER);
 	}
 
-	if (!parent)
-		return NULL;
-
 	fwnode_for_each_child_node(parent, child) {
 		err = -EINVAL;
 		if (is_acpi_device_node(child))
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Fri, 6 May 2022 13:00:29 -0700 you wrote:

Since commit 4e30e98c4b4c ("dpaa2-mac: return -EPROBE_DEFER from dpaa2_mac_open in case the fwnode is not set") @parent can't be NULL after the if. It's either the address
of the ->fwnode of @dpmacs or @fwnode in case of ACPI.

---
Right, Ioana? Let's clean this up so the of_node_put() bots go away.

[...]

Here is the summary with links:
- [net-next] eth: dpaa2-mac: remove a dead-code NULL check on fwnode parent

    https://git.kernel.org/netdev/net-next/c/b3552d6a3b8b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html