Skip to content
Commit e6790fd8 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller
Browse files

mlx5: avoid unused variable warning



When CONFIG_NET_CLS_ACT is disabled, we get a new warning in the mlx5
ethernet driver because the tc_for_each_action() loop never references
the iterator:

mellanox/mlx5/core/en_tc.c: In function 'mlx5e_stats_flower':
mellanox/mlx5/core/en_tc.c:431:20: error: unused variable 'a' [-Werror=unused-variable]
  struct tc_action *a;

This changes the dummy tc_for_each_action() macro by adding a
cast to void, letting the compiler know that the variable is
intentionally declared but not used here. I could not come up
with a nicer workaround, but this seems to do the trick.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: aad7e08d ("net/mlx5e: Hardware offloaded flower filter statistics support")
Fixes: 00175aec ("net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef")
Acked-By: default avatarAmir Vadai <amir@vadai.me>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b7552e1b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment