From: Leon Romanovsky <leon@kernel.org>
To: Greg Thelen <gthelen@google.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>,
Jack Morgenstein <jackm@dev.mellanox.co.il>,
Matan Barak <matanb@mellanox.com>, Ido Shamay <idos@mellanox.com>,
Yishai Hadas <yishaih@mellanox.com>,
Amir Vadai <amirv@mellanox.com>,
Roland Dreier <roland@purestorage.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, Tariq Toukan <tariqt@mellanox.com>
Subject: Re: [PATCH] net/mlx4: suppress 'may be used uninitialized' warning
Date: Tue, 18 Apr 2017 10:02:19 +0300 [thread overview]
Message-ID: <20170418070219.GA14088@mtr-leonro.local> (raw)
In-Reply-To: <20170418062135.76698-1-gthelen@google.com>
[-- Attachment #1: Type: text/plain, Size: 814 bytes --]
On Mon, Apr 17, 2017 at 11:21:35PM -0700, Greg Thelen wrote:
> gcc 4.8.4 complains that mlx4_SW2HW_MPT_wrapper() uses an uninitialized
> 'mpt' variable:
> drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'mlx4_SW2HW_MPT_wrapper':
> drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2802:12: warning: 'mpt' may be used uninitialized in this function [-Wmaybe-uninitialized]
> mpt->mtt = mtt;
>
> I think this warning is a false complaint. mpt is only used when
> mr_res_start_move_to() return zero, and in all such cases it initializes
> mpt.
> But apparently gcc cannot see that.
>
> Initialize mpt to avoid the warning.
>
> Signed-off-by: Greg Thelen <gthelen@google.com>
> ---
It looks like other callers of mr_res_start_move_to() have the same
"uninitialized" variable.
Thanks
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-04-18 7:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 6:21 Greg Thelen
2017-04-18 7:02 ` Leon Romanovsky [this message]
2017-04-18 7:24 ` Greg Thelen
2017-04-20 17:19 ` David Miller
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=20170418070219.GA14088@mtr-leonro.local \
--to=leon@kernel.org \
--cc=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=gthelen@google.com \
--cc=idos@mellanox.com \
--cc=jackm@dev.mellanox.co.il \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matanb@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=roland@purestorage.com \
--cc=tariqt@mellanox.com \
--cc=yishaih@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
all inboxes | Powered by JetHome®