Skip to contentSkip to conversation

staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c

PATCH New Philipp Hortmann 1 participant 11 messages Oct 1, 2022 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: rtl8192e: Remove unused and unchanged variables in rtl_ps.c

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(-)
Signature · 1 line
2.37.3
#1 lore raw

PATCH 1/10 staging: rtl8192e: Remove unchanged variable bFwCtrlLPS

bFwCtrlLPS is just once initialized and never changed. The evaluation will always have the same result. Remove resulting dead code.

---
 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(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index 89bc989cffba..10b79003c633 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +4 -11
index 8c00b111ddb2..49c50ec21d04 100644
@@ -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);
 		}
 	}
 }
drivers/staging/rtl8192e/rtllib.h +0 -3
index 3c72ed2a30a4..40bea71bcb22 100644
@@ -1264,9 +1264,6 @@ struct rt_pwr_save_ctrl {
 
 	u32				CurPsLevel;
 	u32				RegRfPsLevel;
-
-	bool				bFwCtrlLPS;
-
 };
 
 #define RT_RF_CHANGE_SOURCE u32
Signature · 1 line
2.37.3
#2 lore raw

PATCH 2/10 staging: rtl8192e: Remove unchanged variable bInactivePs

In reply to Philipp Hortmann

bInactivePs is just once initialized and never changed. The evaluation will always have the same result. Remove resulting dead code.

---
 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(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +8 -10
index 41faeb4b9b9b..8c3ce6cc2541 100644
@@ -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) {
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index 10b79003c633..7c0fd2bce923 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +21 -28

69 lines not on this page · raw message

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +22 -26

63 lines not on this page · raw message

drivers/staging/rtl8192e/rtllib.h +0 -2
index 40bea71bcb22..d23d1c3ce39b 100644
@@ -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;
Signature · 1 line
2.37.3
#3 lore raw

PATCH 3/10 staging: rtl8192e: Remove unused variable bIPSModeBackup

In reply to Philipp Hortmann

bIPSModeBackup is just once initialized and never used. Remove resulting dead code.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
 drivers/staging/rtl8192e/rtllib.h            | 1 -
 2 files changed, 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index 7c0fd2bce923..cbb65cfea83a 100644
@@ -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;
drivers/staging/rtl8192e/rtllib.h +0 -1
index d23d1c3ce39b..e0fa87b12ceb 100644
@@ -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;
Signature · 1 line
2.37.3
#4 lore raw

PATCH 4/10 staging: rtl8192e: Remove unused variable bInPowerSaveMode

In reply to Philipp Hortmann

bInPowerSaveMode is just once initialized and changed but never evaluated. Remove resulting dead code.

---
 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(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index cbb65cfea83a..db55b9b65192 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
index 7021f9c435d9..28733dc2038b 100644
@@ -475,7 +475,6 @@ struct r8192_priv {
 
 	bool RegRfOff;
 	bool isRFOff;
-	bool bInPowerSaveMode;
 	u8 bHwRfOffAction;
 
 	bool rf_change_in_progress;
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +0 -2
index fba86ef730b5..1ced5bcebdab 100644
@@ -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);
 	}
 }
Signature · 1 line
2.37.3
#5 lore raw

PATCH 5/10 staging: rtl8192e: Remove unused variable isRFOff

In reply to Philipp Hortmann

isRFOff is just once initialized and changed but never evaluated. Remove resulting dead code.

---
 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(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index db55b9b65192..3cddc9a86f28 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
index 28733dc2038b..23dccd6079ea 100644
@@ -474,7 +474,6 @@ struct r8192_priv {
 	u16 ChannelPlan;
 
 	bool RegRfOff;
-	bool isRFOff;
 	u8 bHwRfOffAction;
 
 	bool rf_change_in_progress;
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +0 -1
index 1ced5bcebdab..1501f7be8eee 100644
@@ -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);
 	}
 }
Signature · 1 line
2.37.3
#6 lore raw

PATCH 6/10 staging: rtl8192e: Remove unchanged variable RegRfOff

In reply to Philipp Hortmann

RegRfOff is just once initialized with false and then set to false again. All evaluations will result in false. Remove resulting dead code.

---
 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(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -6
index 18e4e5d84878..f2cbec6eb08f 100644
@@ -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);
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +0 -1
index 1b592258e640..a44dffa76a39 100644
@@ -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));
 
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index 3cddc9a86f28..e77a73df9bc5 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -2
index 23dccd6079ea..7d716fa12995 100644
@@ -472,8 +472,6 @@ struct r8192_priv {
 
 	u16 RegChannelPlan;
 	u16 ChannelPlan;
-
-	bool RegRfOff;
 	u8 bHwRfOffAction;
 
 	bool rf_change_in_progress;
Signature · 1 line
2.37.3
#7 lore raw

PATCH 7/10 staging: rtl8192e: Remove unchanged variable bDisableNormalResetCheck

In reply to Philipp Hortmann

bDisableNormalResetCheck is just once initialized with false. All evaluations will result in !false. Remove resulting dead code.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ++----
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +2 -4
index e77a73df9bc5..9dcae5d71fb9 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
index 7d716fa12995..8a24037a93ec 100644
@@ -541,7 +541,6 @@ struct r8192_priv {
 
 	enum reset_type ResetProgress;
 	bool		bForcedSilentReset;
-	bool		bDisableNormalResetCheck;
 	u16		TxCounter;
 	u16		RxCounter;
 	bool		bResetInProgress;
Signature · 1 line
2.37.3
#8 lore raw

PATCH 8/10 staging: rtl8192e: Remove unused variable bForcedSilentReset

In reply to Philipp Hortmann

bForcedSilentReset is never evaluated. Remove resulting dead code.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ----
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
 2 files changed, 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -4
index 9dcae5d71fb9..ae0fcbbee2bb 100644
@@ -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;
 }
 
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
index 8a24037a93ec..763ed761bb38 100644
@@ -540,7 +540,6 @@ struct r8192_priv {
 	u32		reset_count;
 
 	enum reset_type ResetProgress;
-	bool		bForcedSilentReset;
 	u16		TxCounter;
 	u16		RxCounter;
 	bool		bResetInProgress;
Signature · 1 line
2.37.3
#9 lore raw

PATCH 9/10 staging: rtl8192e: Remove unused variable ScanDelay

In reply to Philipp Hortmann

ScanDelay is never evaluated. Remove resulting dead code.

---
 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(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +0 -1
index f2cbec6eb08f..c3dcaa27fd2e 100644
@@ -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:
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
index ae0fcbbee2bb..f07f0fc690a3 100644
@@ -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);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -2
index 763ed761bb38..c536131ecd5d 100644
@@ -410,8 +410,6 @@ struct r8192_priv {
 	short	chan;
 	short	sens;
 	short	max_sens;
-
-	u8 ScanDelay;
 	bool ps_force;
 
 	u32 irq_mask[2];
Signature · 1 line
2.37.3
#10 lore raw

PATCH 10/10 staging: rtl8192e: Remove unused variable bDriverIsGoingToUnload

In reply to Philipp Hortmann

bDriverIsGoingToUnload is never evaluated. Remove resulting dead code.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 ---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
 2 files changed, 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -3
index f07f0fc690a3..213aac943ef7 100644
@@ -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;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
index c536131ecd5d..1ae3c77e2fef 100644
@@ -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;
Signature · 1 line
2.37.3