[PATCH] mt76: mt7915: fix sparse warning cast from restricted __le16

Ryder Lee ryder.lee at mediatek.com
Mon Oct 12 12:21:21 EDT 2020


drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse:
sparse: cast from restricted __le16

Fixes: 00b2e16 ("mt76: mt7915: add TxBF capabilities")
Reported-by: kernel test robot <lkp at intel.com>
Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index 51eeb78ca077..2457126fc823 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -351,7 +351,7 @@ mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap,
 	elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER;
 
 	/* num_snd_dim */
-	c = (nss - 1) | (max_t(int, mcs->tx_mcs_160, 1) << 3);
+	c = (nss - 1) | (max_t(int, le16_to_cpu(mcs->tx_mcs_160), 1) << 3);
 	elem->phy_cap_info[5] |= c;
 
 	c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB |
-- 
2.18.0


More information about the Linux-mediatek mailing list