[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xr93tw5m18mi.fsf@gthelen.mtv.corp.google.com>
Date: Tue, 18 Apr 2017 00:24:05 -0700
From: Greg Thelen <gthelen@...gle.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: Or Gerlitz <ogerlitz@...lanox.com>,
Jack Morgenstein <jackm@....mellanox.co.il>,
Matan Barak <matanb@...lanox.com>,
Ido Shamay <idos@...lanox.com>,
Yishai Hadas <yishaih@...lanox.com>,
Amir Vadai <amirv@...lanox.com>,
Roland Dreier <roland@...estorage.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
Tariq Toukan <tariqt@...lanox.com>
Subject: Re: [PATCH] net/mlx4: suppress 'may be used uninitialized' warning
Leon Romanovsky <leon@...nel.org> wrote:
> [ Unknown signature status ]
> 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@...gle.com>
>> ---
>
> It looks like other callers of mr_res_start_move_to() have the same
> "uninitialized" variable.
>
> Thanks
The above is the only mellanox warning I see. So gcc is able to better
analyze the other callsites.
Powered by blists - more mailing lists