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 3/6] staging: rtl8192e: Remove zeroed arrays tx_pwr_level_cck_a and friends
Date: Fri, 20 Jan 2023 21:18:12 +0100 [thread overview]
Message-ID: <b88e6bdd5569ac651692074060fba6f79c68c687.1674244819.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1674244819.git.philipp.g.hortmann@gmail.com>
The arrays tx_pwr_level_cck_a, tx_pwr_level_ofdm_24g_a,
tx_pwr_level_cck_c and tx_pwr_level_ofdm_24g_c are initialized to zero
and never changed. Delete the upper named arrays and set the variables
directly to zero to avoid useless 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 | 11 +++++------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 4 ----
3 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index fdf37c56066c..b721bb72007d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -425,13 +425,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
priv->thermal_meter[1] = (priv->eeprom_thermal_meter &
0xf0) >> 4;
} else if (priv->epromtype == EEPROM_93C56) {
-
- for (i = 0; i < 14; i++) {
- priv->tx_pwr_level_cck_a[i] = 0;
- priv->tx_pwr_level_ofdm_24g_a[i] = 0;
- priv->tx_pwr_level_cck_c[i] = 0;
- priv->tx_pwr_level_ofdm_24g_c[i] = 0;
- }
priv->legacy_ht_tx_pwr_diff =
priv->eeprom_legacy_ht_tx_pwr_diff;
priv->antenna_tx_pwr_diff[0] = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index ff66a97b8763..33e3435b50b2 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -594,14 +594,13 @@ void rtl92e_set_tx_power(struct net_device *dev, u8 channel)
powerlevelOFDM24G = priv->tx_pwr_level_ofdm_24g[channel - 1];
} else if (priv->epromtype == EEPROM_93C56) {
if (priv->rf_type == RF_1T2R) {
- powerlevel = priv->tx_pwr_level_cck_c[channel - 1];
- powerlevelOFDM24G = priv->tx_pwr_level_ofdm_24g_c[channel - 1];
+ powerlevel = 0;
+ powerlevelOFDM24G = 0;
} else if (priv->rf_type == RF_2T4R) {
- powerlevel = priv->tx_pwr_level_cck_a[channel - 1];
- powerlevelOFDM24G = priv->tx_pwr_level_ofdm_24g_a[channel - 1];
+ powerlevel = 0;
+ powerlevelOFDM24G = 0;
- ant_pwr_diff = priv->tx_pwr_level_ofdm_24g_c[channel - 1]
- - priv->tx_pwr_level_ofdm_24g_a[channel - 1];
+ ant_pwr_diff = 0;
ant_pwr_diff &= 0xf;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 596693fbee4c..59049ad349e0 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -464,11 +464,7 @@ struct r8192_priv {
u32 mcs_tx_pwr_level_org_offset[6];
u8 tx_pwr_level_cck[14];
- u8 tx_pwr_level_cck_a[14];
- u8 tx_pwr_level_cck_c[14];
u8 tx_pwr_level_ofdm_24g[14];
- u8 tx_pwr_level_ofdm_24g_a[14];
- u8 tx_pwr_level_ofdm_24g_c[14];
u8 legacy_ht_tx_pwr_diff;
u8 antenna_tx_pwr_diff[3];
--
2.39.0
next prev parent reply other threads:[~2023-01-20 20:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 20:17 [PATCH 0/6] Remove several variables that are zero from struct r8192_priv Philipp Hortmann
2023-01-20 20:17 ` [PATCH 1/6] staging: rtl8192e: Combine three loops to one to init tx_pwr_level_ Philipp Hortmann
2023-01-20 20:18 ` [PATCH 2/6] staging: rtl8192e: Init tx_pwr_level_cck_a and friends directly Philipp Hortmann
2023-01-20 20:18 ` Philipp Hortmann [this message]
2023-01-20 20:18 ` [PATCH 4/6] staging: rtl8192e: Remove ant_pwr_diff which is always zero Philipp Hortmann
2023-01-20 20:18 ` [PATCH 5/6] staging: rtl8192e: Remove u4RegValue " Philipp Hortmann
2023-01-20 20:18 ` [PATCH 6/6] staging: rtl8192e: Remove repeated set to zero of powerlevel and friend 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=b88e6bdd5569ac651692074060fba6f79c68c687.1674244819.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;
as well as URLs for NNTP newsgroup(s).