From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: philipp.g.hortmann@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 3/4] staging: rtl8192e: priv->rf_type is always RF_1T2R
Date: Sat, 25 Mar 2023 14:28:22 +0100 [thread overview]
Message-ID: <20230325132823.22872-4-straube.linux@gmail.com> (raw)
In-Reply-To: <20230325132823.22872-1-straube.linux@gmail.com>
The value of priv->rf_type is always RF_1T2R. Remove if statements
that check for priv->rf_type == RF_1T2R and remove resulting dead
code.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 13 ++++-------
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 7 ++----
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 23 +++++++------------
3 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 0e0096ef4943..b237970ecf85 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -540,8 +540,7 @@ static void _rtl92e_hwconfig(struct net_device *dev)
u32 ratr_value;
ratr_value = regRATR;
- if (priv->rf_type == RF_1T2R)
- ratr_value &= ~(RATE_ALL_OFDM_2SS);
+ ratr_value &= ~(RATE_ALL_OFDM_2SS);
rtl92e_writel(dev, RATR0, ratr_value);
rtl92e_writeb(dev, UFWP, 1);
}
@@ -1886,14 +1885,10 @@ void rtl92e_update_ratr_table(struct net_device *dev)
break;
case IEEE_N_24G:
case IEEE_N_5G:
- if (ieee->ht_info->peer_mimo_ps == 0) {
+ if (ieee->ht_info->peer_mimo_ps == 0)
ratr_value &= 0x0007F007;
- } else {
- if (priv->rf_type == RF_1T2R)
- ratr_value &= 0x000FF007;
- else
- ratr_value &= 0x0F81F007;
- }
+ else
+ ratr_value &= 0x000FF007;
break;
default:
break;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index b1c297d2ae36..bd302f5cb356 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -281,14 +281,11 @@ static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType)
u32 *Rtl819XPHY_REGArray_Table = NULL;
u32 *Rtl819XAGCTAB_Array_Table = NULL;
u16 AGCTAB_ArrayLen, PHY_REGArrayLen = 0;
- struct r8192_priv *priv = rtllib_priv(dev);
AGCTAB_ArrayLen = RTL8192E_AGCTAB_ARR_LEN;
Rtl819XAGCTAB_Array_Table = RTL8192E_AGCTAB_ARR;
- if (priv->rf_type == RF_1T2R) {
- PHY_REGArrayLen = RTL8192E_PHY_REG_1T2R_ARR_LEN;
- Rtl819XPHY_REGArray_Table = RTL8192E_PHY_REG_1T2R_ARR;
- }
+ PHY_REGArrayLen = RTL8192E_PHY_REG_1T2R_ARR_LEN;
+ Rtl819XPHY_REGArray_Table = RTL8192E_PHY_REG_1T2R_ARR;
if (ConfigType == BB_CONFIG_PHY_REG) {
for (i = 0; i < PHY_REGArrayLen; i += 2) {
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index b745b73eedea..46be638677d9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -272,19 +272,14 @@ void rtl92e_init_adaptive_rate(struct net_device *dev)
pra->ping_rssi_enable = 0;
pra->ping_rssi_thresh_for_ra = 15;
-
- if (priv->rf_type == RF_1T2R) {
- pra->upper_rssi_threshold_ratr = 0x000fc000;
- pra->middle_rssi_threshold_ratr = 0x000ff000;
- pra->low_rssi_threshold_ratr = 0x000ff001;
- pra->low_rssi_threshold_ratr_40M = 0x000ff005;
- pra->low_rssi_threshold_ratr_20M = 0x000ff001;
- pra->ping_rssi_ratr = 0x0000000d;
- }
-
+ pra->upper_rssi_threshold_ratr = 0x000fc000;
+ pra->middle_rssi_threshold_ratr = 0x000ff000;
+ pra->low_rssi_threshold_ratr = 0x000ff001;
+ pra->low_rssi_threshold_ratr_40M = 0x000ff005;
+ pra->low_rssi_threshold_ratr_20M = 0x000ff001;
+ pra->ping_rssi_ratr = 0x0000000d;
}
-
static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -383,8 +378,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
u32 ratr_value;
ratr_value = targetRATR;
- if (priv->rf_type == RF_1T2R)
- ratr_value &= ~(RATE_ALL_OFDM_2SS);
+ ratr_value &= ~(RATE_ALL_OFDM_2SS);
rtl92e_writel(dev, RATR0, ratr_value);
rtl92e_writeb(dev, UFWP, 1);
@@ -981,8 +975,7 @@ void rtl92e_dm_restore_state(struct net_device *dev)
priv->rtllib->mode == WIRELESS_MODE_N_5G))
return;
ratr_value = reg_ratr;
- if (priv->rf_type == RF_1T2R)
- ratr_value &= ~(RATE_ALL_OFDM_2SS);
+ ratr_value &= ~(RATE_ALL_OFDM_2SS);
rtl92e_writel(dev, RATR0, ratr_value);
rtl92e_writeb(dev, UFWP, 1);
if (priv->tx_pwr_tracking_init && priv->btxpower_tracking)
--
2.40.0
next prev parent reply other threads:[~2023-03-25 13:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 13:28 [PATCH 0/4] staging: rtl8192e: remove rf_type from r8192_priv Michael Straube
2023-03-25 13:28 ` [PATCH 1/4] staging: rtl8192e: remove RTL819X_DEFAULT_RF_TYPE Michael Straube
2023-03-25 13:28 ` [PATCH 2/4] staging: rtl8192e: remove redundant setting of rf_type Michael Straube
2023-03-25 13:28 ` Michael Straube [this message]
2023-03-25 13:28 ` [PATCH 4/4] staging: rtl8192e: remove rf_type from struct r8192_priv Michael Straube
2023-03-25 19:05 ` [PATCH 0/4] staging: rtl8192e: remove rf_type from r8192_priv 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=20230325132823.22872-4-straube.linux@gmail.com \
--to=straube.linux@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=philipp.g.hortmann@gmail.com \
/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