aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2013-01-05 00:08:37 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-01-27 05:15:48 -0500
commit70806a7fd1ae8942675bb2d415899e9e64440505 (patch)
treec49ab01f3a85c8fa2ccbd1cb4ac0961b62bcd298 /drivers
parent7dbbe5d5a5073d590790007d5b98d7fd51fd2ff5 (diff)
e1000e: cleanup: do not assign a variable a value when not necessary
Static analysis with cppcheck has shown a few instances of a variable being reassigned a value before the old one has been used. None of these ever require the old value to be used so remove the old values. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/e1000e/80003es2lan.c8
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.c6
-rw-r--r--drivers/net/ethernet/intel/e1000e/ethtool.c2
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c10
-rw-r--r--drivers/net/ethernet/intel/e1000e/mac.c2
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c6
-rw-r--r--drivers/net/ethernet/intel/e1000e/phy.c6
7 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index aa5e4cf90a58..ae96facee8fe 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -695,7 +695,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
695static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw) 695static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
696{ 696{
697 struct e1000_phy_info *phy = &hw->phy; 697 struct e1000_phy_info *phy = &hw->phy;
698 s32 ret_val = 0; 698 s32 ret_val;
699 u16 phy_data, index; 699 u16 phy_data, index;
700 700
701 ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data); 701 ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
@@ -1276,7 +1276,7 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
1276 u16 *data) 1276 u16 *data)
1277{ 1277{
1278 u32 kmrnctrlsta; 1278 u32 kmrnctrlsta;
1279 s32 ret_val = 0; 1279 s32 ret_val;
1280 1280
1281 ret_val = e1000_acquire_mac_csr_80003es2lan(hw); 1281 ret_val = e1000_acquire_mac_csr_80003es2lan(hw);
1282 if (ret_val) 1282 if (ret_val)
@@ -1311,7 +1311,7 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
1311 u16 data) 1311 u16 data)
1312{ 1312{
1313 u32 kmrnctrlsta; 1313 u32 kmrnctrlsta;
1314 s32 ret_val = 0; 1314 s32 ret_val;
1315 1315
1316 ret_val = e1000_acquire_mac_csr_80003es2lan(hw); 1316 ret_val = e1000_acquire_mac_csr_80003es2lan(hw);
1317 if (ret_val) 1317 if (ret_val)
@@ -1335,7 +1335,7 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
1335 **/ 1335 **/
1336static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw) 1336static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
1337{ 1337{
1338 s32 ret_val = 0; 1338 s32 ret_val;
1339 1339
1340 /* If there's an alternate MAC address place it in RAR0 1340 /* If there's an alternate MAC address place it in RAR0
1341 * so that it will override the Si installed default perm 1341 * so that it will override the Si installed default perm
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index d48143fefbfe..0f55d79afe39 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1397,7 +1397,7 @@ bool e1000_check_phy_82574(struct e1000_hw *hw)
1397{ 1397{
1398 u16 status_1kbt = 0; 1398 u16 status_1kbt = 0;
1399 u16 receive_errors = 0; 1399 u16 receive_errors = 0;
1400 s32 ret_val = 0; 1400 s32 ret_val;
1401 1401
1402 /* Read PHY Receive Error counter first, if its is max - all F's then 1402 /* Read PHY Receive Error counter first, if its is max - all F's then
1403 * read the Base1000T status register If both are max then PHY is hung. 1403 * read the Base1000T status register If both are max then PHY is hung.
@@ -1542,7 +1542,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
1542 1542
1543 ctrl = er32(CTRL); 1543 ctrl = er32(CTRL);
1544 status = er32(STATUS); 1544 status = er32(STATUS);
1545 rxcw = er32(RXCW); 1545 er32(RXCW);
1546 /* SYNCH bit and IV bit are sticky */ 1546 /* SYNCH bit and IV bit are sticky */
1547 udelay(10); 1547 udelay(10);
1548 rxcw = er32(RXCW); 1548 rxcw = er32(RXCW);
@@ -1812,7 +1812,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
1812static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) 1812static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
1813{ 1813{
1814 if (hw->mac.type == e1000_82571) { 1814 if (hw->mac.type == e1000_82571) {
1815 s32 ret_val = 0; 1815 s32 ret_val;
1816 1816
1817 /* If there's an alternate MAC address place it in RAR0 1817 /* If there's an alternate MAC address place it in RAR0
1818 * so that it will override the Si installed default perm 1818 * so that it will override the Si installed default perm
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index 4262b4d00609..6ab949d0b39b 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -1405,7 +1405,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)
1405{ 1405{
1406 struct e1000_hw *hw = &adapter->hw; 1406 struct e1000_hw *hw = &adapter->hw;
1407 u32 ctrl = er32(CTRL); 1407 u32 ctrl = er32(CTRL);
1408 int link = 0; 1408 int link;
1409 1409
1410 /* special requirements for 82571/82572 fiber adapters */ 1410 /* special requirements for 82571/82572 fiber adapters */
1411 1411
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 13f8fa0984e8..87676b652edc 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -485,7 +485,7 @@ out:
485static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) 485static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
486{ 486{
487 struct e1000_phy_info *phy = &hw->phy; 487 struct e1000_phy_info *phy = &hw->phy;
488 s32 ret_val = 0; 488 s32 ret_val;
489 489
490 phy->addr = 1; 490 phy->addr = 1;
491 phy->reset_delay_us = 100; 491 phy->reset_delay_us = 100;
@@ -783,7 +783,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
783static s32 __e1000_access_emi_reg_locked(struct e1000_hw *hw, u16 address, 783static s32 __e1000_access_emi_reg_locked(struct e1000_hw *hw, u16 address,
784 u16 *data, bool read) 784 u16 *data, bool read)
785{ 785{
786 s32 ret_val = 0; 786 s32 ret_val;
787 787
788 ret_val = e1e_wphy_locked(hw, I82579_EMI_ADDR, address); 788 ret_val = e1e_wphy_locked(hw, I82579_EMI_ADDR, address);
789 if (ret_val) 789 if (ret_val)
@@ -1387,7 +1387,7 @@ static s32 e1000_write_smbus_addr(struct e1000_hw *hw)
1387 u32 strap = er32(STRAP); 1387 u32 strap = er32(STRAP);
1388 u32 freq = (strap & E1000_STRAP_SMT_FREQ_MASK) >> 1388 u32 freq = (strap & E1000_STRAP_SMT_FREQ_MASK) >>
1389 E1000_STRAP_SMT_FREQ_SHIFT; 1389 E1000_STRAP_SMT_FREQ_SHIFT;
1390 s32 ret_val = 0; 1390 s32 ret_val;
1391 1391
1392 strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; 1392 strap &= E1000_STRAP_SMBUS_ADDRESS_MASK;
1393 1393
@@ -1623,7 +1623,7 @@ release:
1623 **/ 1623 **/
1624s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable) 1624s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
1625{ 1625{
1626 s32 ret_val = 0; 1626 s32 ret_val;
1627 u32 ctrl_reg = 0; 1627 u32 ctrl_reg = 0;
1628 u32 ctrl_ext = 0; 1628 u32 ctrl_ext = 0;
1629 u32 reg = 0; 1629 u32 reg = 0;
@@ -2284,7 +2284,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
2284 **/ 2284 **/
2285static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active) 2285static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active)
2286{ 2286{
2287 s32 ret_val = 0; 2287 s32 ret_val;
2288 u16 oem_reg; 2288 u16 oem_reg;
2289 2289
2290 ret_val = e1e_rphy(hw, HV_OEM_BITS, &oem_reg); 2290 ret_val = e1e_rphy(hw, HV_OEM_BITS, &oem_reg);
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index d21f749a6492..0709f49f0335 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -165,7 +165,7 @@ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
165s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) 165s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
166{ 166{
167 u32 i; 167 u32 i;
168 s32 ret_val = 0; 168 s32 ret_val;
169 u16 offset, nvm_alt_mac_addr_offset, nvm_data; 169 u16 offset, nvm_alt_mac_addr_offset, nvm_data;
170 u8 alt_mac_addr[ETH_ALEN]; 170 u8 alt_mac_addr[ETH_ALEN];
171 171
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 12784e804f42..e386e95102f4 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3660,8 +3660,8 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter)
3660 e1e_flush(); 3660 e1e_flush();
3661 3661
3662 /* Clear TSYNCRXCTL_VALID & TSYNCTXCTL_VALID bit */ 3662 /* Clear TSYNCRXCTL_VALID & TSYNCTXCTL_VALID bit */
3663 regval = er32(RXSTMPH); 3663 er32(RXSTMPH);
3664 regval = er32(TXSTMPH); 3664 er32(TXSTMPH);
3665 3665
3666 /* Get and set the System Time Register SYSTIM base frequency */ 3666 /* Get and set the System Time Register SYSTIM base frequency */
3667 ret_val = e1000e_get_base_timinca(adapter, &regval); 3667 ret_val = e1000e_get_base_timinca(adapter, &regval);
@@ -5834,7 +5834,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
5834 struct e1000_hw *hw = &adapter->hw; 5834 struct e1000_hw *hw = &adapter->hw;
5835 u32 i, mac_reg; 5835 u32 i, mac_reg;
5836 u16 phy_reg, wuc_enable; 5836 u16 phy_reg, wuc_enable;
5837 int retval = 0; 5837 int retval;
5838 5838
5839 /* copy MAC RARs to PHY RARs */ 5839 /* copy MAC RARs to PHY RARs */
5840 e1000_copy_rx_addrs_to_phy_ich8lan(hw); 5840 e1000_copy_rx_addrs_to_phy_ich8lan(hw);
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index b4aaf69f4410..44fb432f3c10 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -2671,7 +2671,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
2671 **/ 2671 **/
2672s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg) 2672s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
2673{ 2673{
2674 s32 ret_val = 0; 2674 s32 ret_val;
2675 2675
2676 /* Select Port Control Registers page */ 2676 /* Select Port Control Registers page */
2677 ret_val = e1000_set_page_igp(hw, (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); 2677 ret_val = e1000_set_page_igp(hw, (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT));
@@ -3103,8 +3103,8 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
3103 u16 *data, bool read) 3103 u16 *data, bool read)
3104{ 3104{
3105 s32 ret_val; 3105 s32 ret_val;
3106 u32 addr_reg = 0; 3106 u32 addr_reg;
3107 u32 data_reg = 0; 3107 u32 data_reg;
3108 3108
3109 /* This takes care of the difference with desktop vs mobile phy */ 3109 /* This takes care of the difference with desktop vs mobile phy */
3110 addr_reg = (hw->phy.type == e1000_phy_82578) ? 3110 addr_reg = (hw->phy.type == e1000_phy_82578) ?