linux-next: build warning after merge of the net tree

2 messages, 2 authors, 2018-08-22 · open the first message on its own page

linux-next: build warning after merge of the net tree

From: Stephen Rothwell <hidden>
Date: 2018-08-21 22:05:01

Hi all,

After merging the net tree, today's linux-next build (KCONFIG_NAME)
produced this warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c: In function 'tc_fill_actions':
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c:64:6: warning: unused variable 'i' [-Wunused-variable]
  int i;
      ^

Introduced by commit

  244cd96adb5f ("net_sched: remove list_head from tc_action")

-- 
Cheers,
Stephen Rothwell

Re: linux-next: build warning after merge of the net tree

From: Cong Wang <hidden>
Date: 2018-08-22 19:26:41

On Tue, Aug 21, 2018 at 3:04 PM Stephen Rothwell [off-list ref] wrote:
Hi all,

After merging the net tree, today's linux-next build (KCONFIG_NAME)
produced this warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c: In function 'tc_fill_actions':
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c:64:6: warning: unused variable 'i' [-Wunused-variable]
  int i;
      ^

Introduced by commit

  244cd96adb5f ("net_sched: remove list_head from tc_action")
I bet you have CONFIG_NET_CLS_ACT=n?

Here is a quick fix:
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index c17d51865469..9ec471ffaa5d 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -303,7 +303,7 @@ static inline void tcf_exts_put_net(struct tcf_exts *exts)
        for (i = 0; i < TCA_ACT_MAX_PRIO && ((a) = (exts)->actions[i]); i++)
 #else
 #define tcf_exts_for_each_action(i, a, exts) \
-       for (; 0; )
+       for ((void)i, (void)a; 0; )
 #endif

 static inline void
Interestingly, neither my compiler nor kbuild-bot's compiler doesn't
catch this.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help