[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170420.131949.157388310132608724.davem@davemloft.net>
Date: Thu, 20 Apr 2017 13:19:49 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: gthelen@...gle.com
Cc: ogerlitz@...lanox.com, jackm@....mellanox.co.il,
matanb@...lanox.com, idos@...lanox.com, yishaih@...lanox.com,
amirv@...lanox.com, roland@...estorage.com, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net/mlx4: suppress 'may be used uninitialized' warning
From: Greg Thelen <gthelen@...gle.com>
Date: Mon, 17 Apr 2017 23:21:35 -0700
> 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>
Appied to net-next.
Powered by blists - more mailing lists