OSDN Git Service

net/mlx5e: Fix unused variable warning when CONFIG_MLX5_ESWITCH is off
authorSaeed Mahameed <saeedm@mellanox.com>
Thu, 11 Jul 2019 19:39:57 +0000 (19:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Jul 2019 22:04:38 +0000 (15:04 -0700)
commit2f1f5a7731df239a0d1965bc6b75ac37dcb803f3
tree3d6ecb2aa328cee0eda02cbaf9ce41ccf2b95937
parentc93dfec10f1d693a897bfd0d6e3a58a5ea7edc91
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: 4e95bc268b91 ("net: flow_offload: add flow_block_cb_setup_simple()")
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
CC: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c