Skip to content

Commit

Permalink
net: make dev_get_port_parent_id slightly more readable
Browse files Browse the repository at this point in the history
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: Antoine Tenart <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
atenart authored and davem330 committed Oct 10, 2021
1 parent 6799955 commit c0288ae
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -9165,14 +9165,11 @@ int dev_get_port_parent_id(struct net_device *dev,
}

err = devlink_compat_switch_id_get(dev, ppid);
if (!err || err != -EOPNOTSUPP)
if (!recurse || err != -EOPNOTSUPP)
return err;

if (!recurse)
return -EOPNOTSUPP;

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)
break;
if (!first.id_len)
Expand Down

0 comments on commit c0288ae

Please sign in to comment.