diff options
author | Antoine Tenart <atenart@kernel.org> | 2021-10-08 17:21:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-10 13:29:14 +0300 |
commit | c0288ae8e6bd402785360de5bbc94ded770af000 (patch) | |
tree | 1c2da194f8c0198b77514161a56de2efefef6bda /net/core | |
parent | 67999555ff42e91de7654488d9a7735bd9e84555 (diff) | |
download | linux-c0288ae8e6bd402785360de5bbc94ded770af000.tar.xz |
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: Antoine Tenart <atenart@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1594cd2955ba..eb61a8821b3a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -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) |