Commit e7799626 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Remove unchanged variable bInactivePs

bInactivePs is just once initialized and never changed. The evaluation
will always have the same result. Remove resulting dead code.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/9f46eebf8220a06a1889eaf2d6bac74dd08cfd1f.1664616227.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85eba7ac
...@@ -81,17 +81,15 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, ...@@ -81,17 +81,15 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
rt_state = priv->rtllib->rf_power_state; rt_state = priv->rtllib->rf_power_state;
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (rt_state == rf_off) {
if (rt_state == rf_off) { if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { netdev_warn(dev, "%s(): RF is OFF.\n",
netdev_warn(dev, "%s(): RF is OFF.\n", __func__);
__func__); return;
return;
}
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
} }
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
} }
priv->rtllib->is_set_key = true; priv->rtllib->is_set_key = true;
if (EntryNo >= TOTAL_CAM_ENTRY) { if (EntryNo >= TOTAL_CAM_ENTRY) {
......
...@@ -886,7 +886,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) ...@@ -886,7 +886,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rf_change_in_progress = false; priv->rf_change_in_progress = false;
priv->bHwRfOffAction = 0; priv->bHwRfOffAction = 0;
priv->SetRFPowerStateInProgress = false; priv->SetRFPowerStateInProgress = false;
priv->rtllib->PowerSaveControl.bInactivePs = true;
priv->rtllib->PowerSaveControl.bIPSModeBackup = false; priv->rtllib->PowerSaveControl.bIPSModeBackup = false;
priv->rtllib->PowerSaveControl.bLeisurePs = true; priv->rtllib->PowerSaveControl.bLeisurePs = true;
priv->rtllib->LPSDelayCnt = 0; priv->rtllib->LPSDelayCnt = 0;
......
...@@ -116,16 +116,14 @@ void rtl92e_ips_enter(struct net_device *dev) ...@@ -116,16 +116,14 @@ void rtl92e_ips_enter(struct net_device *dev)
&(priv->rtllib->PowerSaveControl); &(priv->rtllib->PowerSaveControl);
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
if (pPSC->bInactivePs) { rt_state = priv->rtllib->rf_power_state;
rt_state = priv->rtllib->rf_power_state; if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
if (rt_state == rf_on && !pPSC->bSwRfProcessing && (priv->rtllib->state != RTLLIB_LINKED) &&
(priv->rtllib->state != RTLLIB_LINKED) && (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
(priv->rtllib->iw_mode != IW_MODE_MASTER)) { pPSC->eInactivePowerState = rf_off;
pPSC->eInactivePowerState = rf_off; priv->isRFOff = true;
priv->isRFOff = true; priv->bInPowerSaveMode = true;
priv->bInPowerSaveMode = true; _rtl92e_ps_update_rf_state(dev);
_rtl92e_ps_update_rf_state(dev);
}
} }
} }
...@@ -136,14 +134,12 @@ void rtl92e_ips_leave(struct net_device *dev) ...@@ -136,14 +134,12 @@ void rtl92e_ips_leave(struct net_device *dev)
&(priv->rtllib->PowerSaveControl); &(priv->rtllib->PowerSaveControl);
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
if (pPSC->bInactivePs) { rt_state = priv->rtllib->rf_power_state;
rt_state = priv->rtllib->rf_power_state; if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
if (rt_state != rf_on && !pPSC->bSwRfProcessing && priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) { pPSC->eInactivePowerState = rf_on;
pPSC->eInactivePowerState = rf_on; priv->bInPowerSaveMode = false;
priv->bInPowerSaveMode = false; _rtl92e_ps_update_rf_state(dev);
_rtl92e_ps_update_rf_state(dev);
}
} }
} }
...@@ -165,18 +161,15 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev) ...@@ -165,18 +161,15 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
rt_state = priv->rtllib->rf_power_state; rt_state = priv->rtllib->rf_power_state;
if (rt_state == rf_off) {
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
if (rt_state == rf_off) { netdev_warn(dev, "%s(): RF is OFF.\n",
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n",
__func__);
return;
}
netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n",
__func__); __func__);
schedule_work(&priv->rtllib->ips_leave_wq); return;
} }
netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n",
__func__);
schedule_work(&priv->rtllib->ips_leave_wq);
} }
} }
......
...@@ -252,22 +252,20 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, ...@@ -252,22 +252,20 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
mutex_lock(&priv->wx_mutex); mutex_lock(&priv->wx_mutex);
if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR || if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR ||
ieee->bNetPromiscuousMode) { ieee->bNetPromiscuousMode) {
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (rt_state == rf_off) {
if (rt_state == rf_off) { if (priv->rtllib->rf_off_reason >
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
RF_CHANGE_BY_IPS) { netdev_warn(dev, "%s(): RF is OFF.\n",
netdev_warn(dev, "%s(): RF is OFF.\n",
__func__);
mutex_unlock(&priv->wx_mutex);
return -1;
}
netdev_info(dev,
"=========>%s(): rtl92e_ips_leave\n",
__func__); __func__);
mutex_lock(&priv->rtllib->ips_mutex); mutex_unlock(&priv->wx_mutex);
rtl92e_ips_leave(dev); return -1;
mutex_unlock(&priv->rtllib->ips_mutex);
} }
netdev_info(dev,
"=========>%s(): rtl92e_ips_leave\n",
__func__);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
} }
} }
ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b); ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b);
...@@ -414,19 +412,17 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -414,19 +412,17 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
priv->rtllib->FirstIe_InScan = true; priv->rtllib->FirstIe_InScan = true;
if (priv->rtllib->state != RTLLIB_LINKED) { if (priv->rtllib->state != RTLLIB_LINKED) {
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (rt_state == rf_off) {
if (rt_state == rf_off) { if (priv->rtllib->rf_off_reason >
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
RF_CHANGE_BY_IPS) { netdev_warn(dev, "%s(): RF is OFF.\n",
netdev_warn(dev, "%s(): RF is OFF.\n", __func__);
__func__); mutex_unlock(&priv->wx_mutex);
mutex_unlock(&priv->wx_mutex); return -1;
return -1;
}
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
} }
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
} }
rtllib_stop_scan(priv->rtllib); rtllib_stop_scan(priv->rtllib);
if (priv->rtllib->LedControlHandler) if (priv->rtllib->LedControlHandler)
......
...@@ -1250,8 +1250,6 @@ enum rt_rf_power_state { ...@@ -1250,8 +1250,6 @@ enum rt_rf_power_state {
}; };
struct rt_pwr_save_ctrl { struct rt_pwr_save_ctrl {
bool bInactivePs;
bool bIPSModeBackup; bool bIPSModeBackup;
bool bSwRfProcessing; bool bSwRfProcessing;
enum rt_rf_power_state eInactivePowerState; enum rt_rf_power_state eInactivePowerState;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment