[Intel-wired-lan] [next PATCH S93 08/11] i40e: fix warning about shadowed ring parameter

Bowers, AndrewX andrewx.bowers at intel.com
Thu Aug 2 18:33:04 UTC 2018


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 31, 2018 3:42 AM
> To: Michael, Alice <alice.michael at intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S93 08/11] i40e: fix warning about
> shadowed ring parameter
> 
> From: Jacob Keller <jacob.e.keller at intel.com>
> 
> In commit 147e81ec7568 ("i40e: Test memory before ethtool alloc succeeds")
> code was added to handle ring allocation on systems with low memory.
> 
> It shadowed the ring parameter pointer by introducing a local ring pointer
> inside the for loop. Most of the code in the loop already just accessed the
> ring via &rx_rings[i]. Since most of the code already does this, just remove
> the local variable.
> 
> If someone considers it worth keeping a local around, they should use it for
> the whole section instead of just a couple of accesses.
> 
> This fixes a warning when -Wshadow is enabled
> 
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list