[linux-next:master 8108/9257] drivers/net/wireless/mediatek/mt76/mt7615/mac.c:279:29: 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:   2bd48302750c652889a2604b3df8b591c1d3af08
commit: dc5399a50b45fa7656375612f0c9eb9bf47c0f9f [8108/9257] mt76: reverse the first fragmented frame to 802.11
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20211222/202112222318.8af5g3NE-lkp@xxxxxxxxx/config)
compiler: powerpc-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=dc5399a50b45fa7656375612f0c9eb9bf47c0f9f
        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 dc5399a50b45fa7656375612f0c9eb9bf47c0f9f
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/

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/mt7615/mac.c:279:29: sparse: sparse: cast to restricted __le32
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:279:29: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:279:29: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:279:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] frame_control @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:279:27: sparse:     expected restricted __le16 [usertype] frame_control
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:279:27: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:280:24: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:280:24: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:280:24: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:280:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] seq_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:280:22: sparse:     expected restricted __le16 [usertype] seq_ctrl
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:280:22: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:281:20: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:281:20: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:281:20: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:281:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] qos_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:281:18: sparse:     expected restricted __le32 [usertype] qos_ctrl
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:281:18: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:282:19: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:282:19: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:282:19: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:282:17: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] ht_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:282:17: sparse:     expected restricted __le32 [usertype] ht_ctrl
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:282:17: sparse:     got unsigned long
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:310:25: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:310:37: sparse: sparse: restricted __be16 degrades to integer
--
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:414:29: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:414:29: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:414:29: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:414:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] frame_control @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:414:27: sparse:     expected restricted __le16 [usertype] frame_control
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:414:27: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:415:24: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:415:24: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:415:24: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:415:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] seq_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:415:22: sparse:     expected restricted __le16 [usertype] seq_ctrl
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:415:22: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:416:20: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:416:20: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:416:20: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:416:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] qos_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:416:18: sparse:     expected restricted __le32 [usertype] qos_ctrl
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:416:18: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:19: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:19: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:19: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:17: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] ht_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:17: sparse:     expected restricted __le32 [usertype] ht_ctrl
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:17: sparse:     got unsigned long
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:445:25: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:445:37: sparse: sparse: restricted __be16 degrades to integer
--
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:425:29: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:425:29: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:425:29: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:425:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] frame_control @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:425:27: sparse:     expected restricted __le16 [usertype] frame_control
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:425:27: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:426:24: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:426:24: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:426:24: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:426:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] seq_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:426:22: sparse:     expected restricted __le16 [usertype] seq_ctrl
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:426:22: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:427:20: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:427:20: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:427:20: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:427:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] qos_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:427:18: sparse:     expected restricted __le32 [usertype] qos_ctrl
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:427:18: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:428:19: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:428:19: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:428:19: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:428:17: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] ht_ctrl @@     got unsigned long @@
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:428:17: sparse:     expected restricted __le32 [usertype] ht_ctrl
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:428:17: sparse:     got unsigned long
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:456:25: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7921/mac.c:456:37: sparse: sparse: restricted __be16 degrades to integer

vim +279 drivers/net/wireless/mediatek/mt76/mt7615/mac.c

   251	
   252	/* The HW does not translate the mac header to 802.3 for mesh point */
   253	static int mt7615_reverse_frag0_hdr_trans(struct sk_buff *skb, u16 hdr_gap)
   254	{
   255		struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb;
   256		struct mt7615_sta *msta = (struct mt7615_sta *)status->wcid;
   257		struct ieee80211_sta *sta;
   258		struct ieee80211_vif *vif;
   259		struct ieee80211_hdr hdr;
   260		struct ethhdr eth_hdr;
   261		__le32 *rxd = (__le32 *)skb->data;
   262		__le32 qos_ctrl, ht_ctrl;
   263	
   264		if (FIELD_GET(MT_RXD1_NORMAL_ADDR_TYPE, le32_to_cpu(rxd[1])) !=
   265		    MT_RXD1_NORMAL_U2M)
   266			return -EINVAL;
   267	
   268		if (!(le32_to_cpu(rxd[0]) & MT_RXD0_NORMAL_GROUP_4))
   269			return -EINVAL;
   270	
   271		if (!msta || !msta->vif)
   272			return -EINVAL;
   273	
   274		sta = container_of((void *)msta, struct ieee80211_sta, drv_priv);
   275		vif = container_of((void *)msta->vif, struct ieee80211_vif, drv_priv);
   276	
   277		/* store the info from RXD and ethhdr to avoid being overridden */
   278		memcpy(&eth_hdr, skb->data + hdr_gap, sizeof(eth_hdr));
 > 279		hdr.frame_control = FIELD_GET(MT_RXD4_FRAME_CONTROL, rxd[4]);
 > 280		hdr.seq_ctrl = FIELD_GET(MT_RXD6_SEQ_CTRL, rxd[6]);
 > 281		qos_ctrl = FIELD_GET(MT_RXD6_QOS_CTL, rxd[6]);
 > 282		ht_ctrl = FIELD_GET(MT_RXD7_HT_CONTROL, rxd[7]);
   283	
   284		hdr.duration_id = 0;
   285		ether_addr_copy(hdr.addr1, vif->addr);
   286		ether_addr_copy(hdr.addr2, sta->addr);
   287		switch (le16_to_cpu(hdr.frame_control) &
   288			(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
   289		case 0:
   290			ether_addr_copy(hdr.addr3, vif->bss_conf.bssid);
   291			break;
   292		case IEEE80211_FCTL_FROMDS:
   293			ether_addr_copy(hdr.addr3, eth_hdr.h_source);
   294			break;
   295		case IEEE80211_FCTL_TODS:
   296			ether_addr_copy(hdr.addr3, eth_hdr.h_dest);
   297			break;
   298		case IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS:
   299			ether_addr_copy(hdr.addr3, eth_hdr.h_dest);
   300			ether_addr_copy(hdr.addr4, eth_hdr.h_source);
   301			break;
   302		default:
   303			break;
   304		}
   305	
   306		skb_pull(skb, hdr_gap + sizeof(struct ethhdr) - 2);
   307		if (eth_hdr.h_proto == htons(ETH_P_AARP) ||
   308		    eth_hdr.h_proto == htons(ETH_P_IPX))
   309			ether_addr_copy(skb_push(skb, ETH_ALEN), bridge_tunnel_header);
 > 310		else if (eth_hdr.h_proto >= htons(ETH_P_802_3_MIN))
   311			ether_addr_copy(skb_push(skb, ETH_ALEN), rfc1042_header);
   312		else
   313			skb_pull(skb, 2);
   314	
   315		if (ieee80211_has_order(hdr.frame_control))
   316			memcpy(skb_push(skb, 2), &ht_ctrl, 2);
   317		if (ieee80211_is_data_qos(hdr.frame_control))
   318			memcpy(skb_push(skb, 2), &qos_ctrl, 2);
   319		if (ieee80211_has_a4(hdr.frame_control))
   320			memcpy(skb_push(skb, sizeof(hdr)), &hdr, sizeof(hdr));
   321		else
   322			memcpy(skb_push(skb, sizeof(hdr) - 6), &hdr, sizeof(hdr) - 6);
   323	
   324		status->flag &= ~(RX_FLAG_RADIOTAP_HE | RX_FLAG_RADIOTAP_HE_MU);
   325		return 0;
   326	}
   327	

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




[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