From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 10/11] staging: rtl8192e: Remove unused variables priv->reset_count and reset_cnt
Date: Sun, 1 Oct 2023 15:45:21 +0200 [thread overview]
Message-ID: <27adae9b824a522280485b3d16f14893bf99da4c.1696165351.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1696165351.git.philipp.g.hortmann@gmail.com>
Remove unused variables priv->reset_count, reset_cnt and reset_cnt_highpwr
as those are always 0. All equations result accordingly. Remove dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 49 ++------------------
2 files changed, 4 insertions(+), 46 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index fa5d0eec90d3..0ebebb3c2c35 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -368,7 +368,6 @@ struct r8192_priv {
u32 continue_diff_count;
bool bswitch_fsync;
u8 framesync;
- u32 reset_count;
u16 tx_counter;
u16 rx_ctr;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index fd5228e7a462..c29bc85f9577 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -1088,7 +1088,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- static u32 reset_cnt;
u8 i;
if (!dm_digtable.dig_enable_flag)
@@ -1108,10 +1107,8 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
(priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_thresh))
return;
if (priv->undecorated_smoothed_pwdb <= dm_digtable.rssi_low_thresh) {
- if (dm_digtable.dig_state == DM_STA_DIG_OFF &&
- (priv->reset_count == reset_cnt))
+ if (dm_digtable.dig_state == DM_STA_DIG_OFF)
return;
- reset_cnt = priv->reset_count;
dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
dm_digtable.dig_state = DM_STA_DIG_OFF;
@@ -1136,15 +1133,10 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) {
u8 reset_flag = 0;
- if (dm_digtable.dig_state == DM_STA_DIG_ON &&
- (priv->reset_count == reset_cnt)) {
+ if (dm_digtable.dig_state == DM_STA_DIG_ON) {
_rtl92e_dm_ctrl_initgain_byrssi_highpwr(dev);
return;
}
- if (priv->reset_count != reset_cnt)
- reset_flag = 1;
-
- reset_cnt = priv->reset_count;
dm_digtable.dig_state = DM_STA_DIG_ON;
@@ -1175,7 +1167,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- static u32 reset_cnt_highpwr;
if ((priv->undecorated_smoothed_pwdb >
dm_digtable.rssi_high_power_lowthresh) &&
@@ -1185,8 +1176,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
if (priv->undecorated_smoothed_pwdb >=
dm_digtable.rssi_high_power_highthresh) {
- if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON &&
- (priv->reset_count == reset_cnt_highpwr))
+ if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON)
return;
dm_digtable.dig_highpwr_state = DM_STA_DIG_ON;
@@ -1195,8 +1185,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
else
rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x43);
} else {
- if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF &&
- (priv->reset_count == reset_cnt_highpwr))
+ if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF)
return;
dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF;
@@ -1210,7 +1199,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44);
}
}
- reset_cnt_highpwr = priv->reset_count;
}
static void _rtl92e_dm_initial_gain(struct net_device *dev)
@@ -1218,11 +1206,9 @@ static void _rtl92e_dm_initial_gain(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev);
u8 initial_gain = 0;
static u8 initialized, force_write;
- static u32 reset_cnt;
if (dm_digtable.dig_algorithm_switch) {
initialized = 0;
- reset_cnt = 0;
}
if (rtllib_act_scanning(priv->rtllib, true)) {
@@ -1249,11 +1235,6 @@ static void _rtl92e_dm_initial_gain(struct net_device *dev)
dm_digtable.pre_ig_value = 0;
}
- if (priv->reset_count != reset_cnt) {
- force_write = 1;
- reset_cnt = priv->reset_count;
- }
-
if (dm_digtable.pre_ig_value != rtl92e_readb(dev, rOFDM0_XAAGCCore1))
force_write = 1;
@@ -1274,11 +1255,9 @@ static void _rtl92e_dm_pd_th(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
static u8 initialized, force_write;
- static u32 reset_cnt;
if (dm_digtable.dig_algorithm_switch) {
initialized = 0;
- reset_cnt = 0;
}
if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
@@ -1307,11 +1286,6 @@ static void _rtl92e_dm_pd_th(struct net_device *dev)
dm_digtable.curpd_thstate = DIG_PD_AT_LOW_POWER;
}
- if (priv->reset_count != reset_cnt) {
- force_write = 1;
- reset_cnt = priv->reset_count;
- }
-
if ((dm_digtable.prepd_thstate != dm_digtable.curpd_thstate) ||
(initialized <= 3) || force_write) {
if (dm_digtable.curpd_thstate == DIG_PD_AT_LOW_POWER) {
@@ -1340,13 +1314,10 @@ static void _rtl92e_dm_pd_th(struct net_device *dev)
static void _rtl92e_dm_cs_ratio(struct net_device *dev)
{
- struct r8192_priv *priv = rtllib_priv(dev);
static u8 initialized, force_write;
- static u32 reset_cnt;
if (dm_digtable.dig_algorithm_switch) {
initialized = 0;
- reset_cnt = 0;
}
if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
@@ -1364,11 +1335,6 @@ static void _rtl92e_dm_cs_ratio(struct net_device *dev)
dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER;
}
- if (priv->reset_count != reset_cnt) {
- force_write = 1;
- reset_cnt = priv->reset_count;
- }
-
if ((dm_digtable.precs_ratio_state != dm_digtable.curcs_ratio_state) ||
!initialized || force_write) {
if (dm_digtable.curcs_ratio_state == DIG_CS_RATIO_LOWER)
@@ -1982,7 +1948,6 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
#define RegC38_Fsync_AP_BCM 2
struct r8192_priv *priv = rtllib_priv(dev);
static u8 reg_c38_State = RegC38_Default;
- static u32 reset_cnt;
if (priv->rtllib->link_state == MAC80211_LINKED &&
priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) {
@@ -2066,12 +2031,6 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
}
}
}
- if (priv->reset_count != reset_cnt) {
- rtl92e_writeb(dev, rOFDM0_RxDetector3,
- priv->framesync);
- reg_c38_State = RegC38_Default;
- reset_cnt = priv->reset_count;
- }
}
/*---------------------------Define function prototype------------------------*/
--
2.42.0
next prev parent reply other threads:[~2023-10-01 13:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-01 13:43 [PATCH 00/11] staging: rtl8192e: Remove broken function _rtl92e_if_silent_reset() Philipp Hortmann
2023-10-01 13:43 ` [PATCH 01/11] staging: rtl8192e: Remove ibss_maxjoin_chal Philipp Hortmann
2023-10-01 13:44 ` [PATCH 02/11] staging: rtl8192e: Remove dead code from _rtl92e_if_check_reset() Philipp Hortmann
2023-10-01 13:44 ` [PATCH 03/11] staging: rtl8192e: Remove RESET_TYPE_NORMAL Philipp Hortmann
2023-10-01 13:44 ` [PATCH 04/11] staging: rtl8192e: Remove broken function _rtl92e_if_silent_reset() Philipp Hortmann
2023-10-01 13:44 ` [PATCH 05/11] staging: rtl8192e: Remove unused variable rst_progress Philipp Hortmann
2023-10-01 13:44 ` [PATCH 06/11] staging: rtl8192e: Remove unused variable reset_in_progress Philipp Hortmann
2023-10-01 13:44 ` [PATCH 07/11] staging: rtl8192e: Remove unused parameter from _rtl92e_sta_up() Philipp Hortmann
2023-10-01 13:45 ` [PATCH 08/11] staging: rtl8192e: Remove unused parameter from _rtl92e_up() Philipp Hortmann
2023-10-01 13:45 ` [PATCH 09/11] staging: rtl8192e: Remove unused variable is_silent_reset Philipp Hortmann
2023-10-01 13:45 ` Philipp Hortmann [this message]
2023-10-01 13:45 ` [PATCH 11/11] staging: rtl8192e: Remove r8192_private_handler _rtl92e_wx_force_reset() Philipp Hortmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27adae9b824a522280485b3d16f14893bf99da4c.1696165351.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®