]> git.baikalelectronics.ru Git - kernel.git/commit
mlx5: avoid unused variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 18 May 2016 14:21:07 +0000 (16:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 May 2016 18:23:49 +0000 (11:23 -0700)
commit295cfee7a79d93b5bbebe2efa6f6814e345cc73c
tree7edd0a30a36990987d3a3c9188615c3640933843
parent45df6f6ca5215d669bea31b5b21fa0381b6d21e6
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: Arnd Bergmann <arnd@arndb.de>
Fixes: 02de30036ccc ("net/mlx5e: Hardware offloaded flower filter statistics support")
Fixes: e62523b0ff8d ("net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef")
Acked-By: Amir Vadai <amir@vadai.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/act_api.h