]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
i40e: fix warning about shadowed ring parameter
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 31 Jul 2018 10:41:45 +0000 (03:41 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 7 Aug 2018 19:20:15 +0000 (12:20 -0700)
commit6e2feaa344e651bc1a1ec224018827e36192c039
tree25aa8070c48e202644bae68c2ba9f8c18bffaaec
parent4d9768237c19d7bcea8b284ec98c04a5846977be
i40e: fix warning about shadowed ring parameter

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@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c