staging: rtl8192e: Remove unchanged variable RegRfOff
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sat, 1 Oct 2022 09:41:10 +0000 (11:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Oct 2022 15:19:26 +0000 (17:19 +0200)
RegRfOff is just once initialized with false and then set to false again.
All evaluations will result in false. Remove resulting dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/fa306d364b43fee7b81f5289309e93bb6fccdba5.1664616227.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.h

index 18e4e5d84878a4b89b17082dd453dfa4dc71685a..f2cbec6eb08f29afbf68e17dd00dc61f98c6fbad 100644 (file)
@@ -624,9 +624,6 @@ start:
        }
        priv->pFirmware->status = FW_STATUS_0_INIT;
 
-       if (priv->RegRfOff)
-               priv->rtllib->rf_power_state = rf_off;
-
        ulRegRead = rtl92e_readl(dev, CPU_GEN);
        if (priv->pFirmware->status == FW_STATUS_0_INIT)
                ulRegRead |= CPU_GEN_SYSTEM_RESET;
@@ -756,9 +753,7 @@ start:
 
        rtl92e_writeb(dev, 0x87, 0x0);
 
-       if (priv->RegRfOff) {
-               rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_SW);
-       } else if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) {
+       if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) {
                rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason);
        } else if (priv->rtllib->rf_off_reason >= RF_CHANGE_BY_IPS) {
                rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason);
index 1b592258e64061c477ddbb5cf29c77b879b2b0f2..a44dffa76a39e1596968848c4a949839b6828265 100644 (file)
@@ -1325,7 +1325,6 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
 
                                do {
                                        InitilizeCount--;
-                                       priv->RegRfOff = false;
                                        rtstatus = rtl92e_enable_nic(dev);
                                } while (!rtstatus && (InitilizeCount > 0));
 
index 3cddc9a86f28f4c163cf0d0f01a40ff6f4942a23..e77a73df9bc5726b13832b70c7b43a9085cb967a 100644 (file)
@@ -879,7 +879,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
        priv->RxCounter = 0;
        priv->rtllib->wx_set_enc = 0;
        priv->hw_radio_off = false;
-       priv->RegRfOff = false;
        priv->rtllib->rf_off_reason = 0;
        priv->rf_change_in_progress = false;
        priv->bHwRfOffAction = 0;
index 23dccd6079ea5f1249b48b630afb138b7f4b7d99..7d716fa129953fb005f5d50593ea61099e7fc97c 100644 (file)
@@ -472,8 +472,6 @@ struct r8192_priv {
 
        u16 RegChannelPlan;
        u16 ChannelPlan;
-
-       bool RegRfOff;
        u8 bHwRfOffAction;
 
        bool rf_change_in_progress;