wifi: iwlwifi: dvm: fix -Wunused-const-variable gcc warning
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 19 Jun 2023 10:38:56 +0000 (13:38 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 19 Jun 2023 12:35:29 +0000 (14:35 +0200)
Fix the following gcc 13.1 warning observed with W=1:

drivers/net/wireless/intel/iwlwifi/dvm/rs.c:207:39: warning:
‘iwl_rate_mcs’ defined but not used [-Wunused-const-variable=]

This table is actually used in 'rs_sta_dbgfs_scale_table_read()'
only if CONFIG_MAC80211_DEBUGFS is enabled, so the whole thing
may be moved close to its actual use.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://lore.kernel.org/r/20230619103900.300628-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/dvm/rs.c

index 4b1f006..f4a6f76 100644 (file)
@@ -203,23 +203,6 @@ static const u16 expected_tpt_mimo3_40MHz[4][IWL_RATE_COUNT] = {
        {0, 0, 0, 0, 277, 0, 478, 624, 737, 911, 1026, 1070, 1109}, /* AGG+SGI */
 };
 
-/* mbps, mcs */
-static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = {
-       {  "1", "BPSK DSSS"},
-       {  "2", "QPSK DSSS"},
-       {"5.5", "BPSK CCK"},
-       { "11", "QPSK CCK"},
-       {  "6", "BPSK 1/2"},
-       {  "9", "BPSK 1/2"},
-       { "12", "QPSK 1/2"},
-       { "18", "QPSK 3/4"},
-       { "24", "16QAM 1/2"},
-       { "36", "16QAM 3/4"},
-       { "48", "64QAM 2/3"},
-       { "54", "64QAM 3/4"},
-       { "60", "64QAM 5/6"},
-};
-
 #define MCS_INDEX_PER_STREAM   (8)
 
 static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window)
@@ -3089,6 +3072,23 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
        int index = 0;
        ssize_t ret;
 
+       /* mbps, mcs */
+       static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = {
+               {  "1", "BPSK DSSS"},
+               {  "2", "QPSK DSSS"},
+               {"5.5", "BPSK CCK"},
+               { "11", "QPSK CCK"},
+               {  "6", "BPSK 1/2"},
+               {  "9", "BPSK 1/2"},
+               { "12", "QPSK 1/2"},
+               { "18", "QPSK 3/4"},
+               { "24", "16QAM 1/2"},
+               { "36", "16QAM 3/4"},
+               { "48", "64QAM 2/3"},
+               { "54", "64QAM 3/4"},
+               { "60", "64QAM 5/6"},
+       };
+
        struct iwl_lq_sta *lq_sta = file->private_data;
        struct iwl_priv *priv;
        struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);