[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202011121550.EcLqDiYM-lkp@intel.com>
Date: Thu, 12 Nov 2020 15:20:54 +0800
From: kernel test robot <lkp@...el.com>
To: Ryder Lee <ryder.lee@...iatek.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Felix Fietkau <nbd@....name>
Subject: drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse:
sparse: cast from restricted __le16
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3d5e28bff7ad55aea081c1af516cc1c94a5eca7d
commit: 00b2e16e006390069480e90478aa8b6e924996d7 mt76: mt7915: add TxBF capabilities
date: 6 months ago
config: x86_64-randconfig-s022-20201112 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-106-gd020cf33-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=00b2e16e006390069480e90478aa8b6e924996d7
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 00b2e16e006390069480e90478aa8b6e924996d7
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse: sparse: cast from restricted __le16
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse: sparse: cast from restricted __le16
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse: sparse: cast from restricted __le16
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse: sparse: cast from restricted __le16
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse: sparse: cast from restricted __le16
>> drivers/net/wireless/mediatek/mt76/mt7915/init.c:339:26: sparse: sparse: cast from restricted __le16
vim +339 drivers/net/wireless/mediatek/mt76/mt7915/init.c
296
297 elem->phy_cap_info[3] &= ~IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER;
298 elem->phy_cap_info[4] &= ~IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER;
299
300 c = IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK |
301 IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK;
302 elem->phy_cap_info[5] &= ~c;
303
304 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB |
305 IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB;
306 elem->phy_cap_info[6] &= ~c;
307
308 elem->phy_cap_info[7] &= ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK;
309
310 c = IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US |
311 IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO |
312 IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO;
313 elem->phy_cap_info[2] |= c;
314
315 c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE |
316 IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
317 IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
318 elem->phy_cap_info[4] |= c;
319
320 /* do not support NG16 due to spec D4.0 changes subcarrier idx */
321 c = IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU |
322 IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU;
323
324 if (vif == NL80211_IFTYPE_STATION)
325 c |= IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO;
326
327 elem->phy_cap_info[6] |= c;
328
329 if (nss < 2)
330 return;
331
332 if (vif != NL80211_IFTYPE_AP)
333 return;
334
335 elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER;
336 elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER;
337
338 /* num_snd_dim */
> 339 c = (nss - 1) | (max_t(int, mcs->tx_mcs_160, 1) << 3);
340 elem->phy_cap_info[5] |= c;
341
342 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB |
343 IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB;
344 elem->phy_cap_info[6] |= c;
345
346 /* the maximum cap is 4 x 3, (Nr, Nc) = (3, 2) */
347 elem->phy_cap_info[7] |= min_t(int, nss - 1, 2) << 3;
348 }
349
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (30919 bytes)
Powered by blists - more mailing lists