From patchwork Wed May 18 14:21:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102333 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2665434qge; Wed, 18 May 2016 07:22:09 -0700 (PDT) X-Received: by 10.98.51.132 with SMTP id z126mr11348588pfz.23.1463581328982; Wed, 18 May 2016 07:22:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 129si12402011pff.247.2016.05.18.07.22.08; Wed, 18 May 2016 07:22:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932359AbcEROWA (ORCPT + 29 others); Wed, 18 May 2016 10:22:00 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:57595 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932107AbcEROV6 (ORCPT ); Wed, 18 May 2016 10:21:58 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0LpQRR-1bX8VY3cXN-00f7HU; Wed, 18 May 2016 16:21:46 +0200 From: Arnd Bergmann To: "David S. Miller" Cc: Jiri Pirko , John Fastabend , Amir Vadai , Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mlx5: avoid unused variable warning Date: Wed, 18 May 2016 16:21:07 +0200 Message-Id: <1463581293-1069553-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:RobvSsp1WtuBwvHN7lT9pz5iPtLSX9K6EN+5Ou+mjw+dX+6gjYb nEUuzk59+6kH32uYo2wM9UlexbkU9bNcPWcMsQmfWkNLDe36WJLrlCjRh5ipJYVR8mgt0nV ABOfoOQGXEZ6jae3UuIyEEUEdKFIDhjIbgTUuSTZWKxdY3rpMF8L15n1l7DWB100Uks5FUo O3Ax/wvyxbar9V9FvCQPQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:nt5gjOJL4Gk=:oRwys61sl8RAnGNCqzamye Be587l5P6p09+1a8K08/jZcsUZjixQNxyplQ903HHFrAi/Xyb7JBrpmdhedPbNPf7UpnI1heC W6aB2mnmUzzPoZ8O5em4ZDjtM5Ap1CaZYHRgtl0fmHy0bb0Ct0WB+fM+ZvrKziRa7FDJIuf9M nZNlO+T9+L8CzLCGvytMsym38MYD+rYUv1SuqBgKz8LZ29BphBTtc2YfRH1Ru2Cjtq7SI6j0B 8USTXrZd7KebEBno1LFyEP1K9MXpcRKMGQQ0Exlu97ihzu4dBXl8SkFqLQFIdhtHRN8lkHw16 kWUuRQ4NAu7IO6TNp7tlChhJRFkAR2BSX1uZtZpqgZ1JREVojom7fsgKVlzuvS4LSF0hCZP7L 4t4ncZuLUIUt58PWTQNP+wDnQdON/Fh8ykGxU4+M7dZoqnBwGHfeP8OSvgdzsEC27MTvi40SO K3n1KozxFRO48OMmD9PAijCEhMeUaYsvtzxzcJzMHhszSM3byFvtPYOn2js2P1GhSbncGTw73 6W0v25aOwE7a6UC1mKDn8AT/OE/WFq2+6sab/TOq9tWJbkPKj2IJAu1V8Fk7KuJwCPty/itED iZ5v9JUhO+7aOMLhQsJ8Zrt21THewxKG/PjbOVXiYvhheyxFGk+0gD+gPf8pOS/3EY0cUhQPF mkJEpNyhy+7hJCnoV1jgL9g7DMkNjXv7wcxFAWFbSoF7oxx0kWYCVT88z04TDq2wF3jmBqzpo BGucjFAQtq88BmMz Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: aad7e08d39bd ("net/mlx5e: Hardware offloaded flower filter statistics support") Fixes: 00175aec941e ("net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef") --- include/net/act_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/include/net/act_api.h b/include/net/act_api.h index 2cd9e9bb059a..9a9a8edc138f 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -192,7 +192,7 @@ static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes, #else /* CONFIG_NET_CLS_ACT */ #define tc_no_actions(_exts) true -#define tc_for_each_action(_a, _exts) while (0) +#define tc_for_each_action(_a, _exts) while ((void)(_a), 0) #define tcf_action_stats_update(a, bytes, packets, lastuse) #endif /* CONFIG_NET_CLS_ACT */