priv->rst_progress is set to RESET_TYPE_NORESET and never changed. All equations are true. Remove dead code. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx> --- .../staging/rtl8192e/rtl8192e/r8192E_dev.c | 100 ++++++++---------- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 3 files changed, 47 insertions(+), 55 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index 9ffa9305ff5e..6cfc2254487b 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -485,10 +485,10 @@ bool rtl92e_start_adapter(struct net_device *dev) start: rtl92e_reset_desc_ring(dev); priv->rf_mode = RF_OP_By_SW_3wire; - if (priv->rst_progress == RESET_TYPE_NORESET) { - rtl92e_writeb(dev, ANAPAR, 0x37); - mdelay(500); - } + + rtl92e_writeb(dev, ANAPAR, 0x37); + mdelay(500); + priv->fw_info->status = FW_STATUS_0_INIT; ulRegRead = rtl92e_readl(dev, CPU_GEN); @@ -518,21 +518,20 @@ bool rtl92e_start_adapter(struct net_device *dev) } priv->loopback_mode = RTL819X_NO_LOOPBACK; - if (priv->rst_progress == RESET_TYPE_NORESET) { - ulRegRead = rtl92e_readl(dev, CPU_GEN); - if (priv->loopback_mode == RTL819X_NO_LOOPBACK) - ulRegRead = (ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) | - CPU_GEN_NO_LOOPBACK_SET; - else if (priv->loopback_mode == RTL819X_MAC_LOOPBACK) - ulRegRead |= CPU_CCK_LOOPBACK; - else - netdev_err(dev, "%s: Invalid loopback mode setting.\n", - __func__); + ulRegRead = rtl92e_readl(dev, CPU_GEN); + if (priv->loopback_mode == RTL819X_NO_LOOPBACK) + ulRegRead = (ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) | + CPU_GEN_NO_LOOPBACK_SET; + else if (priv->loopback_mode == RTL819X_MAC_LOOPBACK) + ulRegRead |= CPU_CCK_LOOPBACK; + else + netdev_err(dev, "%s: Invalid loopback mode setting.\n", + __func__); - rtl92e_writel(dev, CPU_GEN, ulRegRead); + rtl92e_writel(dev, CPU_GEN, ulRegRead); + + udelay(500); - udelay(500); - } _rtl92e_hwconfig(dev); rtl92e_writeb(dev, CMDR, CR_RE | CR_TE); @@ -567,8 +566,7 @@ bool rtl92e_start_adapter(struct net_device *dev) rtl92e_writeb(dev, ACK_TIMEOUT, 0x30); - if (priv->rst_progress == RESET_TYPE_NORESET) - rtl92e_set_wireless_mode(dev, priv->rtllib->mode); + rtl92e_set_wireless_mode(dev, priv->rtllib->mode); rtl92e_cam_reset(dev); { u8 SECR_value = 0x0; @@ -607,12 +605,10 @@ bool rtl92e_start_adapter(struct net_device *dev) } } - if (priv->rst_progress == RESET_TYPE_NORESET) { - rtStatus = rtl92e_config_rf(dev); - if (!rtStatus) { - netdev_info(dev, "RF Config failed\n"); - return rtStatus; - } + rtStatus = rtl92e_config_rf(dev); + if (!rtStatus) { + netdev_info(dev, "RF Config failed\n"); + return rtStatus; } rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn, 0x1); @@ -634,39 +630,37 @@ bool rtl92e_start_adapter(struct net_device *dev) else priv->rf_mode = RF_OP_By_SW_3wire; - if (priv->rst_progress == RESET_TYPE_NORESET) { - rtl92e_dm_init_txpower_tracking(dev); - - if (priv->ic_cut >= IC_VersionCut_D) { - tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, - bMaskDWord); - rtl92e_get_bb_reg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord); - - for (i = 0; i < TX_BB_GAIN_TABLE_LEN; i++) { - if (tmpRegA == dm_tx_bb_gain[i]) { - priv->rfa_txpowertrackingindex = i; - priv->rfa_txpowertrackingindex_real = i; - priv->rfa_txpowertracking_default = - priv->rfa_txpowertrackingindex; - break; - } + rtl92e_dm_init_txpower_tracking(dev); + + if (priv->ic_cut >= IC_VersionCut_D) { + tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, + bMaskDWord); + rtl92e_get_bb_reg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord); + + for (i = 0; i < TX_BB_GAIN_TABLE_LEN; i++) { + if (tmpRegA == dm_tx_bb_gain[i]) { + priv->rfa_txpowertrackingindex = i; + priv->rfa_txpowertrackingindex_real = i; + priv->rfa_txpowertracking_default = + priv->rfa_txpowertrackingindex; + break; } + } - TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, - bMaskByte2); + TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, + bMaskByte2); - for (i = 0; i < CCK_TX_BB_GAIN_TABLE_LEN; i++) { - if (TempCCk == dm_cck_tx_bb_gain[i][0]) { - priv->cck_present_attn_20m_def = i; - break; - } + for (i = 0; i < CCK_TX_BB_GAIN_TABLE_LEN; i++) { + if (TempCCk == dm_cck_tx_bb_gain[i][0]) { + priv->cck_present_attn_20m_def = i; + break; } - priv->cck_present_attn_40m_def = 0; - priv->cck_present_attn_diff = 0; - priv->cck_present_attn = - priv->cck_present_attn_20m_def; - priv->btxpower_tracking = false; } + priv->cck_present_attn_40m_def = 0; + priv->cck_present_attn_diff = 0; + priv->cck_present_attn = + priv->cck_present_attn_20m_def; + priv->btxpower_tracking = false; } rtl92e_irq_enable(dev); end: diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 43533410f8d6..7ca6a04d034c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -754,7 +754,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) priv->rfa_txpowertrackingindex = 0; priv->rfc_txpowertrackingindex = 0; priv->cck_pwr_enl = 6; - priv->rst_progress = RESET_TYPE_NORESET; priv->force_reset = false; memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32); priv->rx_ctr = 0; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index d6e924fc8011..855bee78c674 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -370,7 +370,6 @@ struct r8192_priv { u8 framesync; u32 reset_count; - enum reset_type rst_progress; u16 tx_counter; u16 rx_ctr; bool reset_in_progress; -- 2.42.0