All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 9296/10297] drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2492:22: sparse: sparse: cast to restricted __le32
Date: Fri, 22 Oct 2021 16:41:17 +0800	[thread overview]
Message-ID: <202110221610.HS7pdWcA-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4852 bytes --]

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@intel.com>


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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 71131 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Ryder Lee <ryder.lee@mediatek.com>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Felix Fietkau <nbd@nbd.name>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>
Subject: [linux-next:master 9296/10297] drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2492:22: sparse: sparse: cast to restricted __le32
Date: Fri, 22 Oct 2021 16:41:17 +0800	[thread overview]
Message-ID: <202110221610.HS7pdWcA-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4741 bytes --]

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@intel.com>


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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 71131 bytes --]

             reply	other threads:[~2021-10-22  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  8:41 kernel test robot [this message]
2021-10-22  8:41 ` [linux-next:master 9296/10297] drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2492:22: sparse: sparse: cast to restricted __le32 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202110221610.HS7pdWcA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.