Commit 2f1f5a77 authored by Saeed Mahameed's avatar Saeed Mahameed Committed by David S. Miller

net/mlx5e: Fix unused variable warning when CONFIG_MLX5_ESWITCH is off

In mlx5e_setup_tc "priv" variable is not being used if
CONFIG_MLX5_ESWITCH is off, one way to fix this is to actually use it.

mlx5e_setup_tc_mqprio also needs the "priv" variable and it extracts it
on its own. We can simply pass priv to mlx5e_setup_tc_mqprio instead of
netdev and avoid extracting the priv var, which will also resolve the
compiler warning.

Fixes: 4e95bc26 ("net: flow_offload: add flow_block_cb_setup_simple()")
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
CC: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c93dfec1
...@@ -3390,10 +3390,9 @@ static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd) ...@@ -3390,10 +3390,9 @@ static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd)
return 0; return 0;
} }
static int mlx5e_setup_tc_mqprio(struct net_device *netdev, static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
struct tc_mqprio_qopt *mqprio) struct tc_mqprio_qopt *mqprio)
{ {
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_channels new_channels = {}; struct mlx5e_channels new_channels = {};
u8 tc = mqprio->num_tc; u8 tc = mqprio->num_tc;
int err = 0; int err = 0;
...@@ -3475,7 +3474,7 @@ static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type, ...@@ -3475,7 +3474,7 @@ static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
priv, priv, true); priv, priv, true);
#endif #endif
case TC_SETUP_QDISC_MQPRIO: case TC_SETUP_QDISC_MQPRIO:
return mlx5e_setup_tc_mqprio(dev, type_data); return mlx5e_setup_tc_mqprio(priv, type_data);
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment