public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Saeed Mahameed <saeedm@mellanox.com>,
	Hadar Hen Zion <hadarh@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [net] net/mlx5e: fix another -Wmaybe-uninitialized warning
Date: Thu, 12 Jan 2017 17:21:49 +0200	[thread overview]
Message-ID: <46a85790-2cfe-a8d9-f764-4f736fbd1af7@mellanox.com> (raw)
In-Reply-To: <20170111211451.2705705-1-arnd@arndb.de>

On 1/11/2017 11:14 PM, Arnd Bergmann wrote:
> As found by Olof's build bot, today's mainline kernel gained a harmless
> warning about a potential uninitalied variable reference:
>
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c: In function 'parse_tc_fdb_actions':
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:769:13: warning: 'out_dev' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:811:21: note: 'out_dev' was declared here
>
> This was introduced through the addition of an 'IS_ERR/PTR_ERR' pair that
> gcc is unfortunately unable to completely figure out. Replacing it with
> PTR_ERR_OR_ZERO makes the code more understandable to gcc so it no longer
> warns.

can you elaborate on this a little further?

> Hadar Hen Zion already attempted to fix the warning earlier by adding
> fake initializations, but that ended up just making the code worse without
> fully addressing all warnings, so I'm reverting it now that it is no longer needed.

ok, so if your approach eliminates the warning on out_dev and also on 
the variables for which Hadar added the faked initializers, I guess we 
should be fine with this change (saw your reply on my other comment), 
just another question:

> In order to avoid pulling a variable declaration into the #ifdef, I'm
> removing it in favor of a more readable 'if()' statement here that has the same effect.

When I build here without CONFIG_INET in my system, the build goes fine 
with this approach. However, we're pretty sure that in the past we got 
0-day report from the kbuild test robot where he was unhappy that we 
make the ip_route_output_key call without being wrapped with that #if 
IS_ENABLED(CONFIG_INET) -- so, we don't want to go there again... thoughts?

Or.

  parent reply	other threads:[~2017-01-12 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 21:14 [PATCH] [net] net/mlx5e: fix another -Wmaybe-uninitialized warning Arnd Bergmann
2017-01-12  8:30 ` Or Gerlitz
2017-01-12 10:10   ` Arnd Bergmann
2017-01-12 15:21 ` Or Gerlitz [this message]
2017-01-12 16:04   ` Arnd Bergmann
2017-01-12 20:55     ` Or Gerlitz

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=46a85790-2cfe-a8d9-f764-4f736fbd1af7@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=hadarh@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@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