diff mbox series

[net] net: dsa: fix spurious error message when unoffloaded port leaves bridge

Message ID 20211012112730.3429157-1-alvin@pqrs.dk (mailing list archive)
State Accepted
Commit 43a4b4dbd48c9006ef64df3a12acf33bdfe11c61
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: fix spurious error message when unoffloaded port leaves bridge | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag present in non-next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 7 of 7 maintainers
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: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Alvin Šipraga Oct. 12, 2021, 11:27 a.m. UTC
From: Alvin Šipraga <alsi@bang-olufsen.dk>

Flip the sign of a return value check, thereby suppressing the following
spurious error:

  port 2 failed to notify DSA_NOTIFIER_BRIDGE_LEAVE: -EOPNOTSUPP

... which is emitted when removing an unoffloaded DSA switch port from a
bridge.

Fixes: d371b7c92d19 ("net: dsa: Unset vlan_filtering when ports leave the bridge")
Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
---
 net/dsa/switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Oltean Oct. 12, 2021, 11:36 a.m. UTC | #1
On Tue, Oct 12, 2021 at 01:27:31PM +0200, Alvin Šipraga wrote:
> From: Alvin Šipraga <alsi@bang-olufsen.dk>
> 
> Flip the sign of a return value check, thereby suppressing the following
> spurious error:
> 
>   port 2 failed to notify DSA_NOTIFIER_BRIDGE_LEAVE: -EOPNOTSUPP
> 
> ... which is emitted when removing an unoffloaded DSA switch port from a
> bridge.
> 
> Fixes: d371b7c92d19 ("net: dsa: Unset vlan_filtering when ports leave the bridge")
> Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
> ---
>  net/dsa/switch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/dsa/switch.c b/net/dsa/switch.c
> index 1c797ec8e2c2..6466d0539af9 100644
> --- a/net/dsa/switch.c
> +++ b/net/dsa/switch.c
> @@ -168,7 +168,7 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
>  		if (extack._msg)
>  			dev_err(ds->dev, "port %d: %s\n", info->port,
>  				extack._msg);
> -		if (err && err != EOPNOTSUPP)
> +		if (err && err != -EOPNOTSUPP)
>  			return err;
>  	}
>  
> -- 
> 2.32.0
> 

Ouch, good catch.

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Florian Fainelli Oct. 12, 2021, 4:20 p.m. UTC | #2
On 10/12/21 4:27 AM, Alvin Šipraga wrote:
> From: Alvin Šipraga <alsi@bang-olufsen.dk>
> 
> Flip the sign of a return value check, thereby suppressing the following
> spurious error:
> 
>   port 2 failed to notify DSA_NOTIFIER_BRIDGE_LEAVE: -EOPNOTSUPP
> 
> ... which is emitted when removing an unoffloaded DSA switch port from a
> bridge.
> 
> Fixes: d371b7c92d19 ("net: dsa: Unset vlan_filtering when ports leave the bridge")
> Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
patchwork-bot+netdevbpf@kernel.org Oct. 12, 2021, 11:30 p.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 12 Oct 2021 13:27:31 +0200 you wrote:
> From: Alvin Šipraga <alsi@bang-olufsen.dk>
> 
> Flip the sign of a return value check, thereby suppressing the following
> spurious error:
> 
>   port 2 failed to notify DSA_NOTIFIER_BRIDGE_LEAVE: -EOPNOTSUPP
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: fix spurious error message when unoffloaded port leaves bridge
    https://git.kernel.org/netdev/net/c/43a4b4dbd48c

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/dsa/switch.c b/net/dsa/switch.c
index 1c797ec8e2c2..6466d0539af9 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -168,7 +168,7 @@  static int dsa_switch_bridge_leave(struct dsa_switch *ds,
 		if (extack._msg)
 			dev_err(ds->dev, "port %d: %s\n", info->port,
 				extack._msg);
-		if (err && err != EOPNOTSUPP)
+		if (err && err != -EOPNOTSUPP)
 			return err;
 	}