From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932246AbcERPLh (ORCPT ); Wed, 18 May 2016 11:11:37 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34496 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753574AbcERPLc (ORCPT ); Wed, 18 May 2016 11:11:32 -0400 Date: Wed, 18 May 2016 18:11:27 +0300 From: "Amir Vadai\"" To: Arnd Bergmann Cc: "David S. Miller" , Jiri Pirko , John Fastabend , Amir Vadai , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mlx5: avoid unused variable warning Message-ID: <20160518151127.GA14887@office.localdomain> References: <1463581293-1069553-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463581293-1069553-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 18, 2016 at 04:21:07PM +0200, Arnd Bergmann wrote: > 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") > --- Acked-By: Amir Vadai Thanks Arnd.