[dpdk-dev] [PATCH 04/70] net/e1000/base: remove shadowing variable declarations

Guinan Sun guinanx.sun at intel.com
Mon Jun 22 08:45:28 CEST 2020


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.keller at intel.com>
Signed-off-by: Guinan Sun <guinanx.sun at 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



More information about the dev mailing list