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,7 +81,6 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
enum rt_rf_power_state rt_state;
rt_state = priv->rtllib->rf_power_state;
if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == rf_off) {
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n",
......@@ -92,7 +91,6 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
}
}
priv->rtllib->is_set_key = true;
if (EntryNo >= TOTAL_CAM_ENTRY) {
netdev_info(dev, "%s(): Invalid CAM entry\n", __func__);
......
......@@ -886,7 +886,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rf_change_in_progress = false;
priv->bHwRfOffAction = 0;
priv->SetRFPowerStateInProgress = false;
priv->rtllib->PowerSaveControl.bInactivePs = true;
priv->rtllib->PowerSaveControl.bIPSModeBackup = false;
priv->rtllib->PowerSaveControl.bLeisurePs = true;
priv->rtllib->LPSDelayCnt = 0;
......
......@@ -116,7 +116,6 @@ void rtl92e_ips_enter(struct net_device *dev)
&(priv->rtllib->PowerSaveControl);
enum rt_rf_power_state rt_state;
if (pPSC->bInactivePs) {
rt_state = priv->rtllib->rf_power_state;
if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
(priv->rtllib->state != RTLLIB_LINKED) &&
......@@ -126,7 +125,6 @@ void rtl92e_ips_enter(struct net_device *dev)
priv->bInPowerSaveMode = true;
_rtl92e_ps_update_rf_state(dev);
}
}
}
void rtl92e_ips_leave(struct net_device *dev)
......@@ -136,7 +134,6 @@ void rtl92e_ips_leave(struct net_device *dev)
&(priv->rtllib->PowerSaveControl);
enum rt_rf_power_state rt_state;
if (pPSC->bInactivePs) {
rt_state = priv->rtllib->rf_power_state;
if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
......@@ -144,7 +141,6 @@ void rtl92e_ips_leave(struct net_device *dev)
priv->bInPowerSaveMode = false;
_rtl92e_ps_update_rf_state(dev);
}
}
}
void rtl92e_ips_leave_wq(void *data)
......@@ -165,8 +161,6 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
enum rt_rf_power_state rt_state;
rt_state = priv->rtllib->rf_power_state;
if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == rf_off) {
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n",
......@@ -177,7 +171,6 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
__func__);
schedule_work(&priv->rtllib->ips_leave_wq);
}
}
}
void rtl92e_rtllib_ips_leave(struct net_device *dev)
......
......@@ -252,7 +252,6 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
mutex_lock(&priv->wx_mutex);
if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR ||
ieee->bNetPromiscuousMode) {
if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == rf_off) {
if (priv->rtllib->rf_off_reason >
RF_CHANGE_BY_IPS) {
......@@ -269,7 +268,6 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
mutex_unlock(&priv->rtllib->ips_mutex);
}
}
}
ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b);
mutex_unlock(&priv->wx_mutex);
......@@ -414,7 +412,6 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
priv->rtllib->FirstIe_InScan = true;
if (priv->rtllib->state != RTLLIB_LINKED) {
if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == rf_off) {
if (priv->rtllib->rf_off_reason >
RF_CHANGE_BY_IPS) {
......@@ -427,7 +424,6 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
rtl92e_ips_leave(dev);
mutex_unlock(&priv->rtllib->ips_mutex);
}
}
rtllib_stop_scan(priv->rtllib);
if (priv->rtllib->LedControlHandler)
priv->rtllib->LedControlHandler(dev,
......
......@@ -1250,8 +1250,6 @@ enum rt_rf_power_state {
};
struct rt_pwr_save_ctrl {
bool bInactivePs;
bool bIPSModeBackup;
bool bSwRfProcessing;
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