[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190712085823.4111911-1-arnd@arndb.de>
Date: Fri, 12 Jul 2019 10:57:11 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Saeed Mahameed <saeedm@...lanox.com>,
Leon Romanovsky <leon@...nel.org>,
"David S. Miller" <davem@...emloft.net>
Cc: Arnd Bergmann <arnd@...db.de>,
Pablo Neira Ayuso <pablo@...filter.org>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Tariq Toukan <tariqt@...lanox.com>,
Or Gerlitz <ogerlitz@...lanox.com>,
Maxim Mikityanskiy <maximmi@...lanox.com>,
Eran Ben Elisha <eranbe@...lanox.com>,
Aya Levin <ayal@...lanox.com>, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] [net-next, netfilter] mlx5: avoid unused variable warning
Without CONFIG_MLX5_ESWITCH we get a harmless warning:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:3467:21: error: unused variable 'priv' [-Werror,-Wunused-variable]
struct mlx5e_priv *priv = netdev_priv(dev);
Hide the declaration in the same #ifdef as its usage.
Fixes: 4e95bc268b91 ("net: flow_offload: add flow_block_cb_setup_simple()")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 6d0ae87c8ded..b562ba904ea1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3464,7 +3464,9 @@ static LIST_HEAD(mlx5e_block_cb_list);
static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
{
+#ifdef CONFIG_MLX5_ESWITCH
struct mlx5e_priv *priv = netdev_priv(dev);
+#endif
switch (type) {
#ifdef CONFIG_MLX5_ESWITCH
--
2.20.0
Powered by blists - more mailing lists