Skip to content
Snippets Groups Projects
  1. Apr 21, 2017
    • Greg Thelen's avatar
      net/mlx4: suppress 'may be used uninitialized' warning · 8dc7d11f
      Greg Thelen authored
      
      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: default avatarGreg Thelen <gthelen@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8dc7d11f
  2. Apr 20, 2017
  3. Apr 19, 2017