wifi: mt76: make const arrays in functions static
authorFelix Fietkau <nbd@nbd.name>
Fri, 19 Apr 2024 08:02:16 +0000 (10:02 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 2 May 2024 10:44:52 +0000 (12:44 +0200)
Reduces size by avoiding duplicates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
drivers/net/wireless/mediatek/mt76/mt7996/main.c
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c

index 5650f1bb87421551eeff520a2fec4cb4a0119d13..18ba20cf4bd0dc1742caaf6ce1f35ee938bc30e8 100644 (file)
@@ -1193,7 +1193,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
        int tx_ant = hweight8(phy->mt76->chainmask) - 1;
        struct sta_rec_bf *bf;
        struct tlv *tlv;
-       const u8 matrix[4][4] = {
+       static const u8 matrix[4][4] = {
                {0, 0, 0, 0},
                {1, 1, 0, 0},   /* 2x1, 2x2, 2x3, 2x4 */
                {2, 4, 4, 0},   /* 3x1, 3x2, 3x3, 3x4 */
index 8b4ce32a2cd12f75184d3c9bbe263dc3f91e1c60..6a3a448db75a25001ab8cfefac93956c2ff9b547 100644 (file)
@@ -1100,12 +1100,12 @@ int mt7921_mcu_config_sniffer(struct mt792x_vif *vif,
 {
        struct cfg80211_chan_def *chandef = &ctx->def;
        int freq1 = chandef->center_freq1, freq2 = chandef->center_freq2;
-       const u8 ch_band[] = {
+       static const u8 ch_band[] = {
                [NL80211_BAND_2GHZ] = 1,
                [NL80211_BAND_5GHZ] = 2,
                [NL80211_BAND_6GHZ] = 3,
        };
-       const u8 ch_width[] = {
+       static const u8 ch_width[] = {
                [NL80211_CHAN_WIDTH_20_NOHT] = 0,
                [NL80211_CHAN_WIDTH_20] = 0,
                [NL80211_CHAN_WIDTH_40] = 0,
index bd37cb8d734b9a00999e3f9086e2214a7ac81771..652a9accc43cc317930612c68cd9eda856e6c4e2 100644 (file)
@@ -1768,12 +1768,12 @@ int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,
        struct cfg80211_chan_def *chandef = ctx ? &ctx->def : &mphy->chandef;
        int freq1 = chandef->center_freq1, freq2 = chandef->center_freq2;
 
-       const u8 ch_band[] = {
+       static const u8 ch_band[] = {
                [NL80211_BAND_2GHZ] = 1,
                [NL80211_BAND_5GHZ] = 2,
                [NL80211_BAND_6GHZ] = 3,
        };
-       const u8 ch_width[] = {
+       static const u8 ch_width[] = {
                [NL80211_CHAN_WIDTH_20_NOHT] = 0,
                [NL80211_CHAN_WIDTH_20] = 0,
                [NL80211_CHAN_WIDTH_40] = 0,
index 338ff10b121d73c42e3f0eb43e591c0f72d2756a..21373bd2a81395143b553c035be70e39199f1e16 100644 (file)
@@ -450,7 +450,7 @@ mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
               const struct ieee80211_tx_queue_params *params)
 {
        struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
-       const u8 mq_to_aci[] = {
+       static const u8 mq_to_aci[] = {
                [IEEE80211_AC_VO] = 3,
                [IEEE80211_AC_VI] = 2,
                [IEEE80211_AC_BE] = 0,
index 4f8e656b2cae5656fe6f28e3a02d6943de80a0ca..4bd74e182973ae570ec64797000d34fbef63ded8 100644 (file)
@@ -1656,7 +1656,7 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb,
        int tx_ant = hweight8(phy->mt76->chainmask) - 1;
        struct sta_rec_bf *bf;
        struct tlv *tlv;
-       const u8 matrix[4][4] = {
+       static const u8 matrix[4][4] = {
                {0, 0, 0, 0},
                {1, 1, 0, 0},   /* 2x1, 2x2, 2x3, 2x4 */
                {2, 4, 4, 0},   /* 3x1, 3x2, 3x3, 3x4 */