Skip to content

Commit 191672c

Browse files
arndbdavem330
authored andcommitted
net_sched: fix unused variable warning in stmmac
The new tcf_exts_for_each_action() macro doesn't reference its arguments when CONFIG_NET_CLS_ACT is disabled, which leads to a harmless warning in at least one driver: drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c: In function 'tc_fill_actions': drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c:64:6: error: unused variable 'i' [-Werror=unused-variable] Adding a cast to void lets us avoid this kind of warning. To be on the safe side, do it for all three arguments, not just the one that caused the warning. Fixes: 244cd96 ("net_sched: remove list_head from tc_action") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 93cfb6c commit 191672c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/pkt_cls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static inline void tcf_exts_put_net(struct tcf_exts *exts)
303303
for (i = 0; i < TCA_ACT_MAX_PRIO && ((a) = (exts)->actions[i]); i++)
304304
#else
305305
#define tcf_exts_for_each_action(i, a, exts) \
306-
for (; 0; )
306+
for (; 0; (void)(i), (void)(a), (void)(exts))
307307
#endif
308308

309309
static inline void

0 commit comments

Comments
 (0)