diff mbox series

[net-next] net: make dev_get_port_parent_id slightly more readable

Message ID 20211008142103.732398-1-atenart@kernel.org (mailing list archive)
State Accepted
Commit c0288ae8e6bd402785360de5bbc94ded770af000
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: make dev_get_port_parent_id slightly more readable | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 7 maintainers not CCed: arnd@arndb.de memxor@gmail.com daniel@iogearbox.net edumazet@google.com bjorn@kernel.org alobakin@pm.me weiwan@google.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Antoine Tenart Oct. 8, 2021, 2:21 p.m. UTC
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>
---
 net/core/dev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 10, 2021, 10:40 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri,  8 Oct 2021 16:21:03 +0200 you wrote:
> 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>
> ---
>  net/core/dev.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Here is the summary with links:
  - [net-next] net: make dev_get_port_parent_id slightly more readable
    https://git.kernel.org/netdev/net-next/c/c0288ae8e6bd

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index 16ab09b6a7f8..35fb32279d7f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9159,14 +9159,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)