* [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c
@ 2022-10-01 9:40 Philipp Hortmann
2022-10-01 9:40 ` [PATCH 01/10] staging: rtl8192e: Remove unchanged variable bFwCtrlLPS Philipp Hortmann
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unchanged and unused CamelCase variables that lead to dead code.
Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e
Philipp Hortmann (10):
staging: rtl8192e: Remove unchanged variable bFwCtrlLPS
staging: rtl8192e: Remove unchanged variable bInactivePs
staging: rtl8192e: Remove unused variable bIPSModeBackup
staging: rtl8192e: Remove unused variable bInPowerSaveMode
staging: rtl8192e: Remove unused variable isRFOff
staging: rtl8192e: Remove unchanged variable RegRfOff
staging: rtl8192e: Remove unchanged variable bDisableNormalResetCheck
staging: rtl8192e: Remove unused variable bForcedSilentReset
staging: rtl8192e: Remove unused variable ScanDelay
staging: rtl8192e: Remove unused variable bDriverIsGoingToUnload
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 8 +--
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 18 +++---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 20 +-----
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 9 ---
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 61 +++++++------------
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 48 +++++++--------
drivers/staging/rtl8192e/rtllib.h | 6 --
8 files changed, 55 insertions(+), 116 deletions(-)
--
2.37.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 01/10] staging: rtl8192e: Remove unchanged variable bFwCtrlLPS
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
@ 2022-10-01 9:40 ` Philipp Hortmann
2022-10-01 9:40 ` [PATCH 02/10] staging: rtl8192e: Remove unchanged variable bInactivePs Philipp Hortmann
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bFwCtrlLPS is just once initialized and never changed. The evaluation will
always have the same result. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 15 ++++-----------
drivers/staging/rtl8192e/rtllib.h | 3 ---
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 89bc989cffba..10b79003c633 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -889,7 +889,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rtllib->PowerSaveControl.bInactivePs = true;
priv->rtllib->PowerSaveControl.bIPSModeBackup = false;
priv->rtllib->PowerSaveControl.bLeisurePs = true;
- priv->rtllib->PowerSaveControl.bFwCtrlLPS = false;
priv->rtllib->LPSDelayCnt = 0;
priv->rtllib->sta_sleep = LPS_IS_WAKE;
priv->rtllib->rf_power_state = rf_on;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 8c00b111ddb2..49c50ec21d04 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -229,11 +229,8 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
- if (!pPSC->bFwCtrlLPS) {
- if (priv->rtllib->SetFwCmdHandler)
- priv->rtllib->SetFwCmdHandler(
- dev, FW_CMD_LPS_ENTER);
- }
+ if (priv->rtllib->SetFwCmdHandler)
+ priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER);
_rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST |
RTLLIB_PS_UNICAST);
}
@@ -251,12 +248,8 @@ void rtl92e_leisure_ps_leave(struct net_device *dev)
if (pPSC->bLeisurePs) {
if (priv->rtllib->ps != RTLLIB_PS_DISABLED) {
_rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED);
-
- if (!pPSC->bFwCtrlLPS) {
- if (priv->rtllib->SetFwCmdHandler)
- priv->rtllib->SetFwCmdHandler(dev,
- FW_CMD_LPS_LEAVE);
- }
+ if (priv->rtllib->SetFwCmdHandler)
+ priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE);
}
}
}
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 3c72ed2a30a4..40bea71bcb22 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1264,9 +1264,6 @@ struct rt_pwr_save_ctrl {
u32 CurPsLevel;
u32 RegRfPsLevel;
-
- bool bFwCtrlLPS;
-
};
#define RT_RF_CHANGE_SOURCE u32
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 02/10] staging: rtl8192e: Remove unchanged variable bInactivePs
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
2022-10-01 9:40 ` [PATCH 01/10] staging: rtl8192e: Remove unchanged variable bFwCtrlLPS Philipp Hortmann
@ 2022-10-01 9:40 ` Philipp Hortmann
2022-10-01 9:40 ` [PATCH 03/10] staging: rtl8192e: Remove unused variable bIPSModeBackup Philipp Hortmann
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bInactivePs is just once initialized and never changed. The evaluation
will always have the same result. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 18 ++++---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 49 +++++++++-----------
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 48 +++++++++----------
drivers/staging/rtl8192e/rtllib.h | 2 -
5 files changed, 51 insertions(+), 67 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
index 41faeb4b9b9b..8c3ce6cc2541 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
@@ -81,17 +81,15 @@ 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",
- __func__);
- return;
- }
- mutex_lock(&priv->rtllib->ips_mutex);
- rtl92e_ips_leave(dev);
- mutex_unlock(&priv->rtllib->ips_mutex);
+ if (rt_state == rf_off) {
+ if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
+ netdev_warn(dev, "%s(): RF is OFF.\n",
+ __func__);
+ return;
}
+ mutex_lock(&priv->rtllib->ips_mutex);
+ rtl92e_ips_leave(dev);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
priv->rtllib->is_set_key = true;
if (EntryNo >= TOTAL_CAM_ENTRY) {
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 10b79003c633..7c0fd2bce923 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -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;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 49c50ec21d04..fba86ef730b5 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -116,16 +116,14 @@ 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) &&
- (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
- pPSC->eInactivePowerState = rf_off;
- priv->isRFOff = true;
- priv->bInPowerSaveMode = true;
- _rtl92e_ps_update_rf_state(dev);
- }
+ rt_state = priv->rtllib->rf_power_state;
+ if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
+ (priv->rtllib->state != RTLLIB_LINKED) &&
+ (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
+ pPSC->eInactivePowerState = rf_off;
+ priv->isRFOff = true;
+ priv->bInPowerSaveMode = true;
+ _rtl92e_ps_update_rf_state(dev);
}
}
@@ -136,14 +134,12 @@ 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) {
- pPSC->eInactivePowerState = rf_on;
- priv->bInPowerSaveMode = false;
- _rtl92e_ps_update_rf_state(dev);
- }
+ rt_state = priv->rtllib->rf_power_state;
+ if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
+ priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
+ pPSC->eInactivePowerState = rf_on;
+ priv->bInPowerSaveMode = false;
+ _rtl92e_ps_update_rf_state(dev);
}
}
@@ -165,18 +161,15 @@ 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",
- __func__);
- return;
- }
- netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n",
+ if (rt_state == rf_off) {
+ if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
+ netdev_warn(dev, "%s(): RF is OFF.\n",
__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);
}
}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 4920cb49e381..12eea4fcb9dd 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -252,22 +252,20 @@ 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) {
- netdev_warn(dev, "%s(): RF is OFF.\n",
- __func__);
- mutex_unlock(&priv->wx_mutex);
- return -1;
- }
- netdev_info(dev,
- "=========>%s(): rtl92e_ips_leave\n",
+ if (rt_state == rf_off) {
+ if (priv->rtllib->rf_off_reason >
+ RF_CHANGE_BY_IPS) {
+ netdev_warn(dev, "%s(): RF is OFF.\n",
__func__);
- mutex_lock(&priv->rtllib->ips_mutex);
- rtl92e_ips_leave(dev);
- mutex_unlock(&priv->rtllib->ips_mutex);
+ mutex_unlock(&priv->wx_mutex);
+ return -1;
}
+ 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);
@@ -414,19 +412,17 @@ 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) {
- netdev_warn(dev, "%s(): RF is OFF.\n",
- __func__);
- mutex_unlock(&priv->wx_mutex);
- return -1;
- }
- mutex_lock(&priv->rtllib->ips_mutex);
- rtl92e_ips_leave(dev);
- mutex_unlock(&priv->rtllib->ips_mutex);
+ if (rt_state == rf_off) {
+ if (priv->rtllib->rf_off_reason >
+ RF_CHANGE_BY_IPS) {
+ netdev_warn(dev, "%s(): RF is OFF.\n",
+ __func__);
+ mutex_unlock(&priv->wx_mutex);
+ return -1;
}
+ mutex_lock(&priv->rtllib->ips_mutex);
+ rtl92e_ips_leave(dev);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
rtllib_stop_scan(priv->rtllib);
if (priv->rtllib->LedControlHandler)
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 40bea71bcb22..d23d1c3ce39b 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 03/10] staging: rtl8192e: Remove unused variable bIPSModeBackup
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
2022-10-01 9:40 ` [PATCH 01/10] staging: rtl8192e: Remove unchanged variable bFwCtrlLPS Philipp Hortmann
2022-10-01 9:40 ` [PATCH 02/10] staging: rtl8192e: Remove unchanged variable bInactivePs Philipp Hortmann
@ 2022-10-01 9:40 ` Philipp Hortmann
2022-10-01 9:40 ` [PATCH 04/10] staging: rtl8192e: Remove unused variable bInPowerSaveMode Philipp Hortmann
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bIPSModeBackup is just once initialized and never used. Remove resulting
dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtllib.h | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 7c0fd2bce923..cbb65cfea83a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -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.bIPSModeBackup = false;
priv->rtllib->PowerSaveControl.bLeisurePs = true;
priv->rtllib->LPSDelayCnt = 0;
priv->rtllib->sta_sleep = LPS_IS_WAKE;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index d23d1c3ce39b..e0fa87b12ceb 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1250,7 +1250,6 @@ enum rt_rf_power_state {
};
struct rt_pwr_save_ctrl {
- bool bIPSModeBackup;
bool bSwRfProcessing;
enum rt_rf_power_state eInactivePowerState;
enum ips_callback_function ReturnPoint;
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 04/10] staging: rtl8192e: Remove unused variable bInPowerSaveMode
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (2 preceding siblings ...)
2022-10-01 9:40 ` [PATCH 03/10] staging: rtl8192e: Remove unused variable bIPSModeBackup Philipp Hortmann
@ 2022-10-01 9:40 ` Philipp Hortmann
2022-10-01 9:41 ` [PATCH 05/10] staging: rtl8192e: Remove unused variable isRFOff Philipp Hortmann
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bInPowerSaveMode is just once initialized and changed but never evaluated.
Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 2 --
3 files changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index cbb65cfea83a..db55b9b65192 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -881,7 +881,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->hw_radio_off = false;
priv->RegRfOff = false;
priv->isRFOff = false;
- priv->bInPowerSaveMode = false;
priv->rtllib->rf_off_reason = 0;
priv->rf_change_in_progress = false;
priv->bHwRfOffAction = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 7021f9c435d9..28733dc2038b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -475,7 +475,6 @@ struct r8192_priv {
bool RegRfOff;
bool isRFOff;
- bool bInPowerSaveMode;
u8 bHwRfOffAction;
bool rf_change_in_progress;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index fba86ef730b5..1ced5bcebdab 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -122,7 +122,6 @@ void rtl92e_ips_enter(struct net_device *dev)
(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
pPSC->eInactivePowerState = rf_off;
priv->isRFOff = true;
- priv->bInPowerSaveMode = true;
_rtl92e_ps_update_rf_state(dev);
}
}
@@ -138,7 +137,6 @@ void rtl92e_ips_leave(struct net_device *dev)
if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
pPSC->eInactivePowerState = rf_on;
- priv->bInPowerSaveMode = false;
_rtl92e_ps_update_rf_state(dev);
}
}
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 05/10] staging: rtl8192e: Remove unused variable isRFOff
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (3 preceding siblings ...)
2022-10-01 9:40 ` [PATCH 04/10] staging: rtl8192e: Remove unused variable bInPowerSaveMode Philipp Hortmann
@ 2022-10-01 9:41 ` Philipp Hortmann
2022-10-01 9:41 ` [PATCH 06/10] staging: rtl8192e: Remove unchanged variable RegRfOff Philipp Hortmann
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
isRFOff is just once initialized and changed but never evaluated. Remove
resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 1 -
3 files changed, 3 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index db55b9b65192..3cddc9a86f28 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -880,7 +880,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rtllib->wx_set_enc = 0;
priv->hw_radio_off = false;
priv->RegRfOff = false;
- priv->isRFOff = false;
priv->rtllib->rf_off_reason = 0;
priv->rf_change_in_progress = false;
priv->bHwRfOffAction = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 28733dc2038b..23dccd6079ea 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -474,7 +474,6 @@ struct r8192_priv {
u16 ChannelPlan;
bool RegRfOff;
- bool isRFOff;
u8 bHwRfOffAction;
bool rf_change_in_progress;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 1ced5bcebdab..1501f7be8eee 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -121,7 +121,6 @@ void rtl92e_ips_enter(struct net_device *dev)
(priv->rtllib->state != RTLLIB_LINKED) &&
(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
pPSC->eInactivePowerState = rf_off;
- priv->isRFOff = true;
_rtl92e_ps_update_rf_state(dev);
}
}
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 06/10] staging: rtl8192e: Remove unchanged variable RegRfOff
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (4 preceding siblings ...)
2022-10-01 9:41 ` [PATCH 05/10] staging: rtl8192e: Remove unused variable isRFOff Philipp Hortmann
@ 2022-10-01 9:41 ` Philipp Hortmann
2022-10-01 9:41 ` [PATCH 07/10] staging: rtl8192e: Remove unchanged variable bDisableNormalResetCheck Philipp Hortmann
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
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>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 7 +------
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 --
4 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 18e4e5d84878..f2cbec6eb08f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -624,9 +624,6 @@ bool rtl92e_start_adapter(struct net_device *dev)
}
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 @@ bool rtl92e_start_adapter(struct net_device *dev)
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);
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 1b592258e640..a44dffa76a39 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -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));
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 3cddc9a86f28..e77a73df9bc5 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -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;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 23dccd6079ea..7d716fa12995 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -472,8 +472,6 @@ struct r8192_priv {
u16 RegChannelPlan;
u16 ChannelPlan;
-
- bool RegRfOff;
u8 bHwRfOffAction;
bool rf_change_in_progress;
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 07/10] staging: rtl8192e: Remove unchanged variable bDisableNormalResetCheck
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (5 preceding siblings ...)
2022-10-01 9:41 ` [PATCH 06/10] staging: rtl8192e: Remove unchanged variable RegRfOff Philipp Hortmann
@ 2022-10-01 9:41 ` Philipp Hortmann
2022-10-01 9:41 ` [PATCH 08/10] staging: rtl8192e: Remove unused variable bForcedSilentReset Philipp Hortmann
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bDisableNormalResetCheck is just once initialized with false. All
evaluations will result in !false. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ++----
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index e77a73df9bc5..9dcae5d71fb9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -871,7 +871,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->ScanDelay = 50;
priv->ResetProgress = RESET_TYPE_NORESET;
priv->bForcedSilentReset = false;
- priv->bDisableNormalResetCheck = false;
priv->force_reset = false;
memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32);
@@ -1403,13 +1402,12 @@ static void _rtl92e_watchdog_wq_cb(void *data)
}
spin_unlock_irqrestore(&priv->tx_lock, flags);
- if (!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) {
+ if (ResetType == RESET_TYPE_NORMAL) {
priv->ResetProgress = RESET_TYPE_NORMAL;
return;
}
- if (((priv->force_reset) || (!priv->bDisableNormalResetCheck &&
- ResetType == RESET_TYPE_SILENT)))
+ if ((priv->force_reset || ResetType == RESET_TYPE_SILENT))
_rtl92e_if_silent_reset(dev);
priv->force_reset = false;
priv->bForcedSilentReset = false;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 7d716fa12995..8a24037a93ec 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -541,7 +541,6 @@ struct r8192_priv {
enum reset_type ResetProgress;
bool bForcedSilentReset;
- bool bDisableNormalResetCheck;
u16 TxCounter;
u16 RxCounter;
bool bResetInProgress;
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 08/10] staging: rtl8192e: Remove unused variable bForcedSilentReset
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (6 preceding siblings ...)
2022-10-01 9:41 ` [PATCH 07/10] staging: rtl8192e: Remove unchanged variable bDisableNormalResetCheck Philipp Hortmann
@ 2022-10-01 9:41 ` Philipp Hortmann
2022-10-01 9:41 ` [PATCH 09/10] staging: rtl8192e: Remove unused variable ScanDelay Philipp Hortmann
2022-10-01 9:41 ` [PATCH 10/10] staging: rtl8192e: Remove unused variable bDriverIsGoingToUnload Philipp Hortmann
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bForcedSilentReset is never evaluated. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ----
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
2 files changed, 5 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 9dcae5d71fb9..ae0fcbbee2bb 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -870,7 +870,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->CckPwEnl = 6;
priv->ScanDelay = 50;
priv->ResetProgress = RESET_TYPE_NORESET;
- priv->bForcedSilentReset = false;
priv->force_reset = false;
memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32);
@@ -1240,8 +1239,6 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
END:
priv->ResetProgress = RESET_TYPE_NORESET;
priv->reset_count++;
-
- priv->bForcedSilentReset = false;
priv->bResetInProgress = false;
rtl92e_writeb(dev, UFWP, 1);
@@ -1410,7 +1407,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
if ((priv->force_reset || ResetType == RESET_TYPE_SILENT))
_rtl92e_if_silent_reset(dev);
priv->force_reset = false;
- priv->bForcedSilentReset = false;
priv->bResetInProgress = false;
}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 8a24037a93ec..763ed761bb38 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -540,7 +540,6 @@ struct r8192_priv {
u32 reset_count;
enum reset_type ResetProgress;
- bool bForcedSilentReset;
u16 TxCounter;
u16 RxCounter;
bool bResetInProgress;
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 09/10] staging: rtl8192e: Remove unused variable ScanDelay
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (7 preceding siblings ...)
2022-10-01 9:41 ` [PATCH 08/10] staging: rtl8192e: Remove unused variable bForcedSilentReset Philipp Hortmann
@ 2022-10-01 9:41 ` Philipp Hortmann
2022-10-01 9:41 ` [PATCH 10/10] staging: rtl8192e: Remove unused variable bDriverIsGoingToUnload Philipp Hortmann
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
ScanDelay is never evaluated. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 --
3 files changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index f2cbec6eb08f..c3dcaa27fd2e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -503,7 +503,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
priv->ChannelPlan = 0x0;
break;
case EEPROM_CID_Nettronix:
- priv->ScanDelay = 100;
priv->CustomerID = RT_CID_Nettronix;
break;
case EEPROM_CID_Pronet:
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index ae0fcbbee2bb..f07f0fc690a3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -868,7 +868,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rfa_txpowertrackingindex = 0;
priv->rfc_txpowertrackingindex = 0;
priv->CckPwEnl = 6;
- priv->ScanDelay = 50;
priv->ResetProgress = RESET_TYPE_NORESET;
priv->force_reset = false;
memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 763ed761bb38..c536131ecd5d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -410,8 +410,6 @@ struct r8192_priv {
short chan;
short sens;
short max_sens;
-
- u8 ScanDelay;
bool ps_force;
u32 irq_mask[2];
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 10/10] staging: rtl8192e: Remove unused variable bDriverIsGoingToUnload
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
` (8 preceding siblings ...)
2022-10-01 9:41 ` [PATCH 09/10] staging: rtl8192e: Remove unused variable ScanDelay Philipp Hortmann
@ 2022-10-01 9:41 ` Philipp Hortmann
9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2022-10-01 9:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
bDriverIsGoingToUnload is never evaluated. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 ---
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
2 files changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index f07f0fc690a3..213aac943ef7 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -686,7 +686,6 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
(&priv->rtllib->PowerSaveControl);
bool init_status;
- priv->bDriverIsGoingToUnload = false;
priv->bdisable_nic = false;
priv->up = 1;
@@ -735,7 +734,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
if (priv->rtllib->state == RTLLIB_LINKED)
rtl92e_leisure_ps_leave(dev);
- priv->bDriverIsGoingToUnload = true;
priv->up = 0;
priv->rtllib->ieee_up = 0;
priv->bfirst_after_down = true;
@@ -838,7 +836,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->polling_timer_on = 0;
priv->up_first_time = 1;
priv->blinked_ingpio = false;
- priv->bDriverIsGoingToUnload = false;
priv->being_init_adapter = false;
priv->initialized_at_probe = false;
priv->bdisable_nic = false;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index c536131ecd5d..1ae3c77e2fef 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -311,7 +311,6 @@ struct r8192_priv {
bool bfirst_after_down;
bool initialized_at_probe;
bool being_init_adapter;
- bool bDriverIsGoingToUnload;
int irq;
short irq_enabled;
--
2.37.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-10-01 9:41 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-01 9:40 [PATCH 00/10] staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c Philipp Hortmann
2022-10-01 9:40 ` [PATCH 01/10] staging: rtl8192e: Remove unchanged variable bFwCtrlLPS Philipp Hortmann
2022-10-01 9:40 ` [PATCH 02/10] staging: rtl8192e: Remove unchanged variable bInactivePs Philipp Hortmann
2022-10-01 9:40 ` [PATCH 03/10] staging: rtl8192e: Remove unused variable bIPSModeBackup Philipp Hortmann
2022-10-01 9:40 ` [PATCH 04/10] staging: rtl8192e: Remove unused variable bInPowerSaveMode Philipp Hortmann
2022-10-01 9:41 ` [PATCH 05/10] staging: rtl8192e: Remove unused variable isRFOff Philipp Hortmann
2022-10-01 9:41 ` [PATCH 06/10] staging: rtl8192e: Remove unchanged variable RegRfOff Philipp Hortmann
2022-10-01 9:41 ` [PATCH 07/10] staging: rtl8192e: Remove unchanged variable bDisableNormalResetCheck Philipp Hortmann
2022-10-01 9:41 ` [PATCH 08/10] staging: rtl8192e: Remove unused variable bForcedSilentReset Philipp Hortmann
2022-10-01 9:41 ` [PATCH 09/10] staging: rtl8192e: Remove unused variable ScanDelay Philipp Hortmann
2022-10-01 9:41 ` [PATCH 10/10] staging: rtl8192e: Remove unused variable bDriverIsGoingToUnload Philipp Hortmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.