staging: rtl8192e: Remove zeroed arrays tx_pwr_level_cck_a and friends
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Fri, 20 Jan 2023 20:18:12 +0000 (21:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Jan 2023 18:04:38 +0000 (19:04 +0100)
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>
Link: https://lore.kernel.org/r/b88e6bdd5569ac651692074060fba6f79c68c687.1674244819.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.h

index fdf37c5..b721bb7 100644 (file)
@@ -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;
index ff66a97..33e3435 100644 (file)
@@ -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;
 
index 596693f..59049ad 100644 (file)
@@ -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];