From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: [Patch net] net_sched: fix a compiler warning for tcf_exts_for_each_action() Date: Wed, 22 Aug 2018 12:40:57 -0700 Message-ID: <20180822194057.27818-1-xiyou.wangcong@gmail.com> Cc: sfr@canb.auug.org.au, Cong Wang To: netdev@vger.kernel.org Return-path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:39120 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbeHVXHZ (ORCPT ); Wed, 22 Aug 2018 19:07:25 -0400 Received: by mail-pg1-f195.google.com with SMTP id m3-v6so468286pgp.6 for ; Wed, 22 Aug 2018 12:41:13 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: When CONFIG_NET_CLS_ACT=n, tcf_exts_for_each_action() is a nop, which leaves its parameters unused. Shut up the compiler warning by casting them to void. Fixes: 244cd96adb5f ("net_sched: remove list_head from tc_action") Reported-by: Stephen Rothwell Signed-off-by: Cong Wang --- include/net/pkt_cls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.14.4