staging: rtl8192e: Remove dead code: dig_t::dbg_mode, drx_path_sel::DbgMode
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Mon, 8 Jun 2015 21:23:34 +0000 (23:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jun 2015 00:13:27 +0000 (17:13 -0700)
dig_t::dbg_mode and drx_path_sel::DbgMode are initialized to one value and
checked only once in code.This patch throws them away, and deletes
always-true conditions.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h

index d273452..8532e0c 100644 (file)
@@ -1308,7 +1308,6 @@ static void dm_dig_init(struct net_device *dev)
 
        dm_digtable.dig_algorithm = DIG_ALGO_BY_RSSI;
 
-       dm_digtable.dbg_mode = DM_DBG_OFF;
        dm_digtable.dig_algorithm_switch = 0;
 
        dm_digtable.dig_state           = DM_STA_DIG_MAX;
@@ -1388,8 +1387,7 @@ static void dm_ctrl_initgain_byrssi_by_driverrssi(
                dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT;
 
 
-       if (dm_digtable.dbg_mode == DM_DBG_OFF)
-               dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb;
+       dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb;
        dm_initial_gain(dev);
        dm_pd_th(dev);
        dm_cs_ratio(dev);
@@ -1946,7 +1944,6 @@ static void dm_init_rxpath_selection(struct net_device *dev)
                DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
        else
                DM_RxPathSelTable.cck_method = CCK_Rx_Version_1;
-       DM_RxPathSelTable.DbgMode = DM_DBG_OFF;
        DM_RxPathSelTable.disabledRF = 0;
        for (i = 0; i < 4; i++) {
                DM_RxPathSelTable.rf_rssi[i] = 50;
@@ -1989,8 +1986,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
                DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
 
        for (i = 0; i < RF90_PATH_MAX; i++) {
-               if (!DM_RxPathSelTable.DbgMode)
-                       DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i];
+               DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i];
 
                if (priv->brfpath_rxenable[i]) {
                        rf_num++;
index ae2034e..b037451 100644 (file)
@@ -87,7 +87,6 @@
 struct dig_t {
        u8              dig_enable_flag;
        u8              dig_algorithm;
-       u8              dbg_mode;
        u8              dig_algorithm_switch;
 
        long            rssi_low_thresh;
@@ -130,23 +129,6 @@ enum dm_ratr_sta {
        DM_RATR_STA_MAX
 };
 
-enum dm_dig_op_sta {
-       DIG_TYPE_THRESH_HIGH    = 0,
-       DIG_TYPE_THRESH_LOW     = 1,
-       DIG_TYPE_THRESH_HIGHPWR_HIGH    = 2,
-       DIG_TYPE_THRESH_HIGHPWR_LOW     = 3,
-       DIG_TYPE_DBG_MODE                               = 4,
-       DIG_TYPE_RSSI                                           = 5,
-       DIG_TYPE_ALGORITHM                              = 6,
-       DIG_TYPE_BACKOFF                                        = 7,
-       DIG_TYPE_PWDB_FACTOR                    = 8,
-       DIG_TYPE_RX_GAIN_MIN                            = 9,
-       DIG_TYPE_RX_GAIN_MAX                            = 10,
-       DIG_TYPE_ENABLE                 = 20,
-       DIG_TYPE_DISABLE                = 30,
-       DIG_OP_TYPE_MAX
-};
-
 enum dm_dig_alg {
        DIG_ALGO_BY_FALSE_ALARM = 0,
        DIG_ALGO_BY_RSSI        = 1,
@@ -180,7 +162,6 @@ enum dm_dig_cs_ratio {
 
 struct drx_path_sel {
        u8              Enable;
-       u8              DbgMode;
        u8              cck_method;
        u8              cck_Rx_path;
 
@@ -201,12 +182,6 @@ enum dm_cck_rx_path_method {
 };
 
 
-enum dm_dbg {
-       DM_DBG_OFF = 0,
-       DM_DBG_ON = 1,
-       DM_DBG_MAX
-};
-
 struct dcmd_txcmd {
        u32     Op;
        u32     Length;