staging: rtl8192e: Remove constant variable reg_max_lps_awake_intvl

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>
This commit is contained in:
Philipp Hortmann 2023-10-06 21:04:54 +02:00 committed by Greg Kroah-Hartman
parent a84ff259bf
commit 02584b2aea
3 changed files with 1 additions and 18 deletions

View 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);

View File

@ -1079,7 +1079,6 @@ struct rt_pwr_save_ctrl {
bool bLeisurePs;
u8 LpsIdleCount;
u8 reg_max_lps_awake_intvl;
u8 LPSAwakeIntvl;
u32 CurPsLevel;

View 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);