mlxsw: spectrum_trap: Use err variable instead of directly checking func return value
authorJiri Pirko <jiri@mellanox.com>
Sun, 23 Feb 2020 07:31:33 +0000 (08:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Feb 2020 00:06:58 +0000 (16:06 -0800)
When calling mlxsw_sp_rx_listener(), use err variable instead of directly
checking func return value.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c

index 60205aa3f6a5a39520a20066c9ec810a916d2133..28d2c09c867e915c5104c29321f2e8193ac4c9d8 100644 (file)
@@ -199,11 +199,13 @@ static void mlxsw_sp_rx_drop_listener(struct sk_buff *skb, u8 local_port,
        struct mlxsw_sp_port *mlxsw_sp_port;
        struct mlxsw_sp *mlxsw_sp;
        struct devlink *devlink;
+       int err;
 
        mlxsw_sp = devlink_trap_ctx_priv(trap_ctx);
        mlxsw_sp_port = mlxsw_sp->ports[local_port];
 
-       if (mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port))
+       err = mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port);
+       if (err)
                return;
 
        devlink = priv_to_devlink(mlxsw_sp->core);
@@ -221,11 +223,13 @@ static void mlxsw_sp_rx_exception_listener(struct sk_buff *skb, u8 local_port,
        struct mlxsw_sp_port *mlxsw_sp_port;
        struct mlxsw_sp *mlxsw_sp;
        struct devlink *devlink;
+       int err;
 
        mlxsw_sp = devlink_trap_ctx_priv(trap_ctx);
        mlxsw_sp_port = mlxsw_sp->ports[local_port];
 
-       if (mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port))
+       err = mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port);
+       if (err)
                return;
 
        devlink = priv_to_devlink(mlxsw_sp->core);