net/mlx5e: Move priv variable into case statement in mlx5e_setup_tc
Subsystems (5)
PATCH 1/1 net/mlx5e: Move priv variable into case statement in mlx5e_setup_tc
There is an unused variable warning on arm64 defconfig when CONFIG_MLX5_ESWITCH is unset:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:3467:21: warning:
unused variable 'priv' [-Wunused-variable]
struct mlx5e_priv *priv = netdev_priv(dev);
^1 warning generated.
Move it down into the case statement where it is used.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4 -3
@@ -3464,15 +3464,16 @@ static LIST_HEAD(mlx5e_block_cb_list);static int mlx5e_setup_tc (struct net_device *dev,enum tc_setup_type type,void *type_data) { -struct mlx5e_priv *priv =netdev_priv (dev); -switch (type) {#ifdef CONFIG_MLX5_ESWITCH -case TC_SETUP_BLOCK : +case TC_SETUP_BLOCK : { +struct mlx5e_priv *priv =netdev_priv (dev); +return flow_block_cb_setup_simple (type_data, &mlx5e_block_cb_list, mlx5e_setup_tc_block_cb, priv, priv, true); + }#endif case TC_SETUP_QDISC_MQPRIO :return mlx5e_setup_tc_mqprio (dev, type_data);
Signature · 1 line
2.22.0
Quoted 30 lines · Nathan Chancellor
There is an unused variable warning on arm64 defconfig when
CONFIG_MLX5_ESWITCHis unset:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:3467:21: warning:
unused variable 'priv' [-Wunused-variable]struct mlx5e_priv *priv = netdev_priv(dev); ^1 warning generated.
Move it down into the case statement where it is used.
Fixes 4e95bc268b91 ("net: flow_offload: add flow_block_cb_setup_simple()")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0
-2@@ -3464,15 +3464,16 @@ static LIST_HEAD(mlx5e_block_cb_list);static int mlx5e_setup_tc (struct net_device *dev,enum tc_setup_type type,void *type_data) { -struct mlx5e_priv *priv =netdev_priv (dev); -switch (type) {
drivers/net/ethernet/mellanox/mlx5/core/en_main.c static LIST_HEAD(mlx5e_block_cb_list); · line 3476
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4
-1#ifdef CONFIG_MLX5_ESWITCH -case TC_SETUP_BLOCK : +case TC_SETUP_BLOCK : { +struct mlx5e_priv *priv =netdev_priv (dev); +return flow_block_cb_setup_simple (type_data, &mlx5e_block_cb_list, mlx5e_setup_tc_block_cb, priv, priv, true); + }
Hi Nathan,
We have another patch internally that fixes this, and it is already queued up in my queue.
it works differently as we want to pass priv instead of netdev to mlx5e_setup_tc_mqprio below,
which will also solve warning ..
So i would like to submit that patch if it is ok with you ?
Quoted 6 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0
-1#endif case TC_SETUP_QDISC_MQPRIO :return mlx5e_setup_tc_mqprio (dev, type_data); --2.22.0
Quoted 45 lines · Saeed Mahameed
Quoted 30 lines · Nathan Chancellor
There is an unused variable warning on arm64 defconfig when
CONFIG_MLX5_ESWITCHis unset:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:3467:21: warning:
unused variable 'priv' [-Wunused-variable]struct mlx5e_priv *priv = netdev_priv(dev); ^1 warning generated.
Move it down into the case statement where it is used.
Fixes 4e95bc268b91 ("net: flow_offload: add flow_block_cb_setup_simple()")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0
-2@@ -3464,15 +3464,16 @@ static LIST_HEAD(mlx5e_block_cb_list);static int mlx5e_setup_tc (struct net_device *dev,enum tc_setup_type type,void *type_data) { -struct mlx5e_priv *priv =netdev_priv (dev); -switch (type) {drivers/net/ethernet/mellanox/mlx5/core/en_main.c static LIST_HEAD(mlx5e_block_cb_list); · line 3476
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4
-1#ifdef CONFIG_MLX5_ESWITCH -case TC_SETUP_BLOCK : +case TC_SETUP_BLOCK : { +struct mlx5e_priv *priv =netdev_priv (dev); +return flow_block_cb_setup_simple (type_data, &mlx5e_block_cb_list, mlx5e_setup_tc_block_cb, priv, priv, true); + }Hi Nathan,
Quoted 7 lines
We have another patch internally that fixes this, and it is already queued up in my queue.
it works differently as we want to pass priv instead of netdev tomlx5e_setup_tc_mqpriobelow,
which will also solve warning ..So i would like to submit that patch if it is ok with you ?
Hi Saeed,
Whatever works best for you, I just care that the warning gets fixed, not how it is done :) I wouldn't mind being put on CC so I can pick it up for my local tests.
Thanks for the follow up!
Nathan