diff mbox series

wifi: mt76: mt7996: fix uninitialized variable warnings

Message ID 11522a6a898ae04a5e1cdc805603ed7e6bd14f7a.1668507269.git.lorenzo@kernel.org
State New
Headers show
Series wifi: mt76: mt7996: fix uninitialized variable warnings | expand

Commit Message

Lorenzo Bianconi Nov. 15, 2022, 11:44 a.m. UTC
Fix uninitialized variable warnings in mt7996/mac.c and mt7996/mcu.c

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 4 ++--
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
index d0a32638a65b..9650590a5d4b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
@@ -200,11 +200,11 @@  static void mt7996_mac_sta_poll(struct mt7996_dev *dev)
 			break;
 		}
 
+		addr = mt7996_mac_wtbl_lmac_addr(dev, idx, 6);
+		val = mt76_rr(dev, addr);
 		if (rate->flags & RATE_INFO_FLAGS_HE_MCS) {
 			u8 offs = 24 + 2 * bw;
 
-			addr = mt7996_mac_wtbl_lmac_addr(dev, idx, 6);
-			val = mt76_rr(dev, addr);
 			rate->he_gi = (val & (0x3 << offs)) >> offs;
 		} else if (rate->flags &
 			   (RATE_INFO_FLAGS_VHT_MCS | RATE_INFO_FLAGS_MCS)) {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 9ce249ac7097..adc80b9930bd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -700,15 +700,14 @@  mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
 	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
 	struct cfg80211_chan_def *chandef = &phy->chandef;
 	struct mt76_connac_bss_basic_tlv *bss;
+	u32 type = CONNECTION_INFRA_AP;
 	struct tlv *tlv;
-	u32 type;
 	int idx;
 
 	switch (vif->type) {
 	case NL80211_IFTYPE_MESH_POINT:
 	case NL80211_IFTYPE_AP:
 	case NL80211_IFTYPE_MONITOR:
-		type = CONNECTION_INFRA_AP;
 		break;
 	case NL80211_IFTYPE_STATION:
 		if (enable) {