Commit c0288ae8 authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

net: make dev_get_port_parent_id slightly more readable

Cosmetic commit making dev_get_port_parent_id slightly more readable.
There is no need to split the condition to return after calling
devlink_compat_switch_id_get and after that 'recurse' is always true.
Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 67999555
...@@ -9165,14 +9165,11 @@ int dev_get_port_parent_id(struct net_device *dev, ...@@ -9165,14 +9165,11 @@ int dev_get_port_parent_id(struct net_device *dev,
} }
err = devlink_compat_switch_id_get(dev, ppid); err = devlink_compat_switch_id_get(dev, ppid);
if (!err || err != -EOPNOTSUPP) if (!recurse || err != -EOPNOTSUPP)
return err; return err;
if (!recurse)
return -EOPNOTSUPP;
netdev_for_each_lower_dev(dev, lower_dev, iter) { netdev_for_each_lower_dev(dev, lower_dev, iter) {
err = dev_get_port_parent_id(lower_dev, ppid, recurse); err = dev_get_port_parent_id(lower_dev, ppid, true);
if (err) if (err)
break; break;
if (!first.id_len) if (!first.id_len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment