staging: rtl8192e: Remove constant variable reg_max_lps_awake_intvl
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Fri, 6 Oct 2023 19:04:54 +0000 (21:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Oct 2023 09:13:56 +0000 (11:13 +0200)
Remove constant variable reg_max_lps_awake_intvl as this value is just
written to MaxPeriod. Function _rtl92e_init_priv_constant() is then empty
and can be removed as well.

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

index f46cb152930a78a39ea1f9a5b98bf7a271e242b8..7db01d68000a02d658ae52fd31b122d9de1d4f26 100644 (file)
@@ -712,15 +712,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)
        priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup;
 }
 
-static void _rtl92e_init_priv_constant(struct net_device *dev)
-{
-       struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
-                                       &priv->rtllib->pwr_save_ctrl;
-
-       psc->reg_max_lps_awake_intvl = 5;
-}
-
 static void _rtl92e_init_priv_variable(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
@@ -838,7 +829,6 @@ static short _rtl92e_init(struct net_device *dev)
        memset(&priv->stats, 0, sizeof(struct rt_stats));
 
        _rtl92e_init_priv_handler(dev);
-       _rtl92e_init_priv_constant(dev);
        _rtl92e_init_priv_variable(dev);
        _rtl92e_init_priv_lock(priv);
        _rtl92e_init_priv_task(dev);
index 6d54c03f56808468665a9b67cfc1acb2a181a9a3..307bcbb7fbb67c3909ad2c94ea936fbe1bdae46c 100644 (file)
@@ -1079,7 +1079,6 @@ struct rt_pwr_save_ctrl {
 
        bool                            bLeisurePs;
        u8                              LpsIdleCount;
-       u8                              reg_max_lps_awake_intvl;
        u8                              LPSAwakeIntvl;
 
        u32                             CurPsLevel;
index 206f8e05d5d02a64489f6879620c61a9b7f343d7..f84133744bc343a190cc614a1afccc81f700a12d 100644 (file)
@@ -1588,16 +1588,10 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)
                if (ieee->bAwakePktSent) {
                        psc->LPSAwakeIntvl = 1;
                } else {
-                       u8 MaxPeriod = 1;
+                       u8 MaxPeriod = 5;
 
                        if (psc->LPSAwakeIntvl == 0)
                                psc->LPSAwakeIntvl = 1;
-                       if (psc->reg_max_lps_awake_intvl == 0)
-                               MaxPeriod = 1;
-                       else if (psc->reg_max_lps_awake_intvl == 0xFF)
-                               MaxPeriod = ieee->current_network.dtim_period;
-                       else
-                               MaxPeriod = psc->reg_max_lps_awake_intvl;
                        psc->LPSAwakeIntvl = (psc->LPSAwakeIntvl >=
                                               MaxPeriod) ? MaxPeriod :
                                               (psc->LPSAwakeIntvl + 1);