linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "davem@davemloft.net" <davem@davemloft.net>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"leon@kernel.org" <leon@kernel.org>
Cc: Aya Levin <ayal@mellanox.com>,
	Maxim Mikityanskiy <maximmi@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	"pablo@netfilter.org" <pablo@netfilter.org>,
	Tariq Toukan <tariqt@mellanox.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	Eran Ben Elisha <eranbe@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [net-next, netfilter] mlx5: avoid unused variable warning
Date: Fri, 12 Jul 2019 18:25:08 +0000	[thread overview]
Message-ID: <1c3219ac5df2da7a3643b253c34b373287ec8ddf.camel@mellanox.com> (raw)
In-Reply-To: <20190712085823.4111911-1-arnd@arndb.de>

On Fri, 2019-07-12 at 10:57 +0200, Arnd Bergmann wrote:
> 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);
> 

Hi Arnd,

thanks for your patch, a similar patch that addresses this issue was
already submitted and applied to net-next [1]

[1] https://www.spinics.net/lists/netdev/msg585433.html

> 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@arndb.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

      reply	other threads:[~2019-07-12 18:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  8:57 [PATCH] [net-next, netfilter] mlx5: avoid unused variable warning Arnd Bergmann
2019-07-12 18:25 ` Saeed Mahameed [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c3219ac5df2da7a3643b253c34b373287ec8ddf.camel@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=arnd@arndb.de \
    --cc=ayal@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maximmi@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=pablo@netfilter.org \
    --cc=tariqt@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).