提交 b731d079 编写于 作者: J Jacob Keller 提交者: Jeff Kirsher

fm10k: reduce the scope of the err variable

Reduce the scope of the local variable err in the fm10k_detach_subtask
function.

This was detected by cppcheck and resolves the following warning
produced by that tool:

[fm10k_pci.c:403]: (style) The scope of the variable 'err' can be reduced.
Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 fb381e60
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2013 - 2018 Intel Corporation. */ /* Copyright(c) 2013 - 2019 Intel Corporation. */
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -344,7 +344,6 @@ static void fm10k_detach_subtask(struct fm10k_intfc *interface) ...@@ -344,7 +344,6 @@ static void fm10k_detach_subtask(struct fm10k_intfc *interface)
struct net_device *netdev = interface->netdev; struct net_device *netdev = interface->netdev;
u32 __iomem *hw_addr; u32 __iomem *hw_addr;
u32 value; u32 value;
int err;
/* do nothing if netdev is still present or hw_addr is set */ /* do nothing if netdev is still present or hw_addr is set */
if (netif_device_present(netdev) || interface->hw.hw_addr) if (netif_device_present(netdev) || interface->hw.hw_addr)
...@@ -362,6 +361,8 @@ static void fm10k_detach_subtask(struct fm10k_intfc *interface) ...@@ -362,6 +361,8 @@ static void fm10k_detach_subtask(struct fm10k_intfc *interface)
hw_addr = READ_ONCE(interface->uc_addr); hw_addr = READ_ONCE(interface->uc_addr);
value = readl(hw_addr); value = readl(hw_addr);
if (~value) { if (~value) {
int err;
/* Make sure the reset was initiated because we detached, /* Make sure the reset was initiated because we detached,
* otherwise we might race with a different reset flow. * otherwise we might race with a different reset flow.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册