aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2019-07-08 16:12:25 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-08-01 14:50:19 -0700
commitd56b47791d3464178be2aa2d61db694331d50d5a (patch)
treea105644a8b1b21a5031d6b3dfd6b66eaae843b0a /drivers/net/ethernet/intel
parentfm10k: reduce the scope of the err variable (diff)
downloadlinux-dev-d56b47791d3464178be2aa2d61db694331d50d5a.tar.xz
linux-dev-d56b47791d3464178be2aa2d61db694331d50d5a.zip
fm10k: reduce the scope of the local i variable
Reduce the scope of the local loop variable in the fm10k_check_hang_subtask function. This was detected by cppcheck and resolves the following warning produced by that tool: [driver/fm10k_pci.c:852]: (style) The scope of the variable 'i' can be reduced. 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>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 9421832c2480..9522e9f8f8b8 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -698,8 +698,6 @@ static void fm10k_watchdog_subtask(struct fm10k_intfc *interface)
*/
static void fm10k_check_hang_subtask(struct fm10k_intfc *interface)
{
- int i;
-
/* If we're down or resetting, just bail */
if (test_bit(__FM10K_DOWN, interface->state) ||
test_bit(__FM10K_RESETTING, interface->state))
@@ -711,6 +709,8 @@ static void fm10k_check_hang_subtask(struct fm10k_intfc *interface)
interface->next_tx_hang_check = jiffies + (2 * HZ);
if (netif_carrier_ok(interface->netdev)) {
+ int i;
+
/* Force detection of hung controller */
for (i = 0; i < interface->num_tx_queues; i++)
set_check_for_tx_hang(interface->tx_ring[i]);