blob: ad1e4b49c7a6deac25c890daf495f36d97be318f [file] [log] [blame]
From 3d94d01385841822ab5b90dd6e70480d96d5fdc0 Mon Sep 17 00:00:00 2001
From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Thu, 27 Jun 2019 10:44:49 +0200
Subject: [PATCH] mt76: mt7615: fix sparse warnings: incorrect type in
assignment (different base types)
commit eda96044de274cbf7263834b5cecb51f1f7b0984 upstream.
Fix the following sparse warning in mt7615_mcu_bss_info_ext_header:
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:728:30: sparse: sparse:
incorrect type in assignment (different base types)
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:728:30: sparse:
expected restricted __le32 [usertype] mbss_tsf_offset
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Fixes: 7339fbc0caa5 ("mt7615: mcu: do not use function pointers whenever possible")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index f877e3862f8d..8f386f7015ad 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -771,7 +771,7 @@ static void bss_info_ext_bss_handler (struct mt7615_dev *dev,
/* SIFS 20us + 512 byte beacon tranmitted by 1Mbps (3906us) */
#define BCN_TX_ESTIMATE_TIME (4096 + 20)
struct bss_info_ext_bss tlv = {0};
- int ext_bss_idx;
+ int ext_bss_idx, tsf_offset;
ext_bss_idx = bss_info->omac_idx - EXT_BSSID_START;
@@ -780,7 +780,8 @@ static void bss_info_ext_bss_handler (struct mt7615_dev *dev,
tlv.tag = cpu_to_le16(BSS_INFO_EXT_BSS);
tlv.len = cpu_to_le16(sizeof(tlv));
- tlv.mbss_tsf_offset = ext_bss_idx * BCN_TX_ESTIMATE_TIME;
+ tsf_offset = ext_bss_idx * BCN_TX_ESTIMATE_TIME;
+ tlv.mbss_tsf_offset = cpu_to_le32(tsf_offset);
memcpy(skb_put(skb, sizeof(tlv)), &tlv, sizeof(tlv));
}
--
2.27.0