[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ab85afaf-bd9d-416a-b54c-9c85062f3f3f@lunn.ch>
Date: Tue, 17 Dec 2024 10:54:53 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Elliot Ayrey <elliot.ayrey@...iedtelesis.co.nz>
Cc: Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"Hans J. Schultz" <netdev@...io-technology.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: dsa: mv88e6xxx: Fix switchdev error code
On Tue, Dec 17, 2024 at 05:39:30PM +1300, Elliot Ayrey wrote:
> Calling a switchdev notifier encodes additional information into the
> return code. Using this value directly makes error messages confusing.
>
> Use notifer_to_errno() to restore the original errno value.
>
> Fixes: 830763b96720 ("net: dsa: mv88e6xxx: mac-auth/MAB implementation")
> Signed-off-by: Elliot Ayrey <elliot.ayrey@...iedtelesis.co.nz>
> ---
> drivers/net/dsa/mv88e6xxx/switchdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/switchdev.c b/drivers/net/dsa/mv88e6xxx/switchdev.c
> index 4c346a884fb2..7c59eca0270d 100644
> --- a/drivers/net/dsa/mv88e6xxx/switchdev.c
> +++ b/drivers/net/dsa/mv88e6xxx/switchdev.c
> @@ -79,5 +79,5 @@ int mv88e6xxx_handle_miss_violation(struct mv88e6xxx_chip *chip, int port,
> brport, &info.info, NULL);
> rtnl_unlock();
>
> - return err;
> + return notifier_to_errno(err);
I just had a quick look at other users of call_switchdev_notifiers()
and all but vxlan_core.c and this one discarded the return
value. Would that be a better fix, making the code more uniform?
Andrew
Powered by blists - more mailing lists