The variable phy_reg is already declared at the top of e1000_check_for_copper_link_ich8lan() and we don't need to re-declare it in the inner if{} scope. Remove the unnecessary extra declarations which fixes the sparse warning generated by shadowed variable names.
Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com> Signed-off-by: Guinan Sun <guinanx....@intel.com> --- drivers/net/e1000/base/e1000_ich8lan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/e1000/base/e1000_ich8lan.c b/drivers/net/e1000/base/e1000_ich8lan.c index 5241cf698..1666826cc 100644 --- a/drivers/net/e1000/base/e1000_ich8lan.c +++ b/drivers/net/e1000/base/e1000_ich8lan.c @@ -1546,8 +1546,6 @@ STATIC s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) if (hw->mac.type >= e1000_pch_lpt) { - u16 phy_reg; - hw->phy.ops.read_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, &phy_reg); phy_reg &= ~I217_PLL_CLOCK_GATE_MASK; -- 2.17.1