staging: rtl8192e: Remove unchanged variable dig_algorithm_switch
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Fri, 13 Oct 2023 14:44:11 +0000 (16:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Oct 2023 16:20:45 +0000 (18:20 +0200)
Remove variable dig_algorithm_switch as its value is set to 0 at
initialization. The equations result accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/a76d8b86f2591446a071b4f614adf628b0fe5c93.1697127817.git.philipp.g.hortmann@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 e69c22e5d205f0b81f9e62bfaaa7d41046f37888..0bd9211500acd7d3b7e42b59ce0ef2832bae272a 100644 (file)
@@ -911,8 +911,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
 
-       dm_digtable.dig_algorithm_switch = 0;
-
        dm_digtable.dig_state           = DM_STA_DIG_MAX;
        dm_digtable.dig_highpwr_state   = DM_STA_DIG_MAX;
        dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT;
@@ -962,8 +960,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
        u8 i;
        static u8       fw_dig;
 
-       if (dm_digtable.dig_algorithm_switch)
-               fw_dig = 0;
        if (fw_dig <= 3) {
                for (i = 0; i < 3; i++)
                        rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x8);
@@ -980,8 +976,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
        _rtl92e_dm_initial_gain(dev);
        _rtl92e_dm_pd_th(dev);
        _rtl92e_dm_cs_ratio(dev);
-       if (dm_digtable.dig_algorithm_switch)
-               dm_digtable.dig_algorithm_switch = 0;
        dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state;
 }
 
@@ -991,10 +985,6 @@ static void _rtl92e_dm_initial_gain(struct net_device *dev)
        u8 initial_gain = 0;
        static u8 initialized, force_write;
 
-       if (dm_digtable.dig_algorithm_switch) {
-               initialized = 0;
-       }
-
        if (rtllib_act_scanning(priv->rtllib, true)) {
                force_write = 1;
                return;
@@ -1040,10 +1030,6 @@ static void _rtl92e_dm_pd_th(struct net_device *dev)
        struct r8192_priv *priv = rtllib_priv(dev);
        static u8 initialized, force_write;
 
-       if (dm_digtable.dig_algorithm_switch) {
-               initialized = 0;
-       }
-
        if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
                if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
                        if (dm_digtable.rssi_val >=
@@ -1100,10 +1086,6 @@ static void _rtl92e_dm_cs_ratio(struct net_device *dev)
 {
        static u8 initialized, force_write;
 
-       if (dm_digtable.dig_algorithm_switch) {
-               initialized = 0;
-       }
-
        if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
                if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
                        if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh)
index 15af490d2dcde4fc2671423ad4e40a30e49e501e..12b7d426b6b9286c4dac70b49481988b1b3e8d73 100644 (file)
@@ -50,8 +50,6 @@
 
 /*------------------------------Define structure----------------------------*/
 struct dig_t {
-       u8              dig_algorithm_switch;
-
        long            rssi_low_thresh;
        long            rssi_high_thresh;