[linux-next:master 9296/10297] drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2492:22: sparse: sparse: cast to restricted __le32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   3196a52aff93186897f15f1a6c03220ce6523d82
commit: 22dffbddf016791e99f02d1ad36f5043ce615085 [9296/10297] mt76: mt7915: introduce mt7915_mcu_beacon_check_caps()
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=22dffbddf016791e99f02d1ad36f5043ce615085
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 22dffbddf016791e99f02d1ad36f5043ce615085
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/mt7915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2492:22: sparse: sparse: cast to restricted __le32
>> drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2492:22: sparse: sparse: cast from restricted __le16

vim +2492 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

  2463	
  2464	static void
  2465	mt7915_mcu_beacon_check_caps(struct mt7915_phy *phy, struct ieee80211_vif *vif,
  2466				     struct sk_buff *skb)
  2467	{
  2468		struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
  2469		struct mt7915_vif_cap *vc = &mvif->cap;
  2470		const struct ieee80211_he_cap_elem *he;
  2471		const struct ieee80211_vht_cap *vht;
  2472		const struct ieee80211_ht_cap *ht;
  2473		struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
  2474		const u8 *ie;
  2475		u32 len, bc;
  2476	
  2477		/* Check missing configuration options to allow AP mode in mac80211
  2478		 * to remain in sync with hostapd settings, and get a subset of
  2479		 * beacon and hardware capabilities.
  2480		 */
  2481		if (WARN_ON_ONCE(skb->len <= (mgmt->u.beacon.variable - skb->data)))
  2482			return;
  2483	
  2484		memset(vc, 0, sizeof(*vc));
  2485	
  2486		len = skb->len - (mgmt->u.beacon.variable - skb->data);
  2487	
  2488		ie = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, mgmt->u.beacon.variable,
  2489				      len);
  2490		if (ie && ie[1] >= sizeof(*ht)) {
  2491			ht = (void *)(ie + 2);
> 2492			bc = le32_to_cpu(ht->cap_info);
  2493	
  2494			vc->ldpc |= !!(bc & IEEE80211_HT_CAP_LDPC_CODING);
  2495		}
  2496	
  2497		ie = cfg80211_find_ie(WLAN_EID_VHT_CAPABILITY, mgmt->u.beacon.variable,
  2498				      len);
  2499		if (ie && ie[1] >= sizeof(*vht)) {
  2500			u32 pc = phy->mt76->sband_5g.sband.vht_cap.cap;
  2501	
  2502			vht = (void *)(ie + 2);
  2503			bc = le32_to_cpu(vht->vht_cap_info);
  2504	
  2505			vc->ldpc |= !!(bc & IEEE80211_VHT_CAP_RXLDPC);
  2506			vc->vht_su_ebfer =
  2507				(bc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE) &&
  2508				(pc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE);
  2509			vc->vht_su_ebfee =
  2510				(bc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE) &&
  2511				(pc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE);
  2512			vc->vht_mu_ebfer =
  2513				(bc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE) &&
  2514				(pc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE);
  2515			vc->vht_mu_ebfee =
  2516				(bc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE) &&
  2517				(pc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
  2518		}
  2519	
  2520		ie = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY,
  2521					  mgmt->u.beacon.variable, len);
  2522		if (ie && ie[1] >= sizeof(*he) + 1) {
  2523			const struct ieee80211_sta_he_cap *pc =
  2524				mt7915_get_he_phy_cap(phy, vif);
  2525			const struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
  2526	
  2527			he = (void *)(ie + 3);
  2528	
  2529			vc->he_su_ebfer =
  2530				HE_PHY(CAP3_SU_BEAMFORMER, he->phy_cap_info[3]) &&
  2531				HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]);
  2532			vc->he_su_ebfee =
  2533				HE_PHY(CAP4_SU_BEAMFORMEE, he->phy_cap_info[4]) &&
  2534				HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
  2535			vc->he_mu_ebfer =
  2536				HE_PHY(CAP4_MU_BEAMFORMER, he->phy_cap_info[4]) &&
  2537				HE_PHY(CAP4_MU_BEAMFORMER, pe->phy_cap_info[4]);
  2538		}
  2539	}
  2540	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux