[linux-next:master 3254/5417] drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1413:23: sparse: sparse: incorrect type in assignment (different base types)

[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:   6d9bd4ad4ca08b1114e814c2c42383b8b13be631
commit: c17780e7b21eca3375e7573600ee0a6c42d954cd [3254/5417] mt76: mt7915: add txfree event v3
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20220212/202202120041.Cyrn5hZL-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=c17780e7b21eca3375e7573600ee0a6c42d954cd
        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 c17780e7b21eca3375e7573600ee0a6c42d954cd
        # 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/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/mac.c:417:29: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:29: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:29: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417: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:417:27: sparse:     expected restricted __le16 [usertype] frame_control
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:417:27: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:418:24: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:418:24: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:418:24: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:418: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:418:22: sparse:     expected restricted __le16 [usertype] seq_ctrl
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:418:22: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:419:20: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:419:20: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:419:20: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:419: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:419:18: sparse:     expected restricted __le32 [usertype] qos_ctrl
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:419:18: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:420:19: sparse: sparse: cast to restricted __le32
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:420:19: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:420:19: sparse: sparse: restricted __le32 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:420: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:420:17: sparse:     expected restricted __le32 [usertype] ht_ctrl
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:420:17: sparse:     got unsigned long
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:448:25: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:448:37: sparse: sparse: restricted __be16 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1413:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] *cur_info @@     got restricted __le32 * @@
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1413:23: sparse:     expected unsigned int [usertype] *cur_info
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1413:23: sparse:     got restricted __le32 *
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1414:34: sparse: sparse: cast to restricted __le32

vim +1413 drivers/net/wireless/mediatek/mt76/mt7915/mac.c

  1378	
  1379	static void
  1380	mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
  1381	{
  1382		struct mt7915_tx_free *free = (struct mt7915_tx_free *)data;
  1383		struct mt76_dev *mdev = &dev->mt76;
  1384		struct mt76_phy *mphy_ext = mdev->phy2;
  1385		struct mt76_txwi_cache *txwi;
  1386		struct ieee80211_sta *sta = NULL;
  1387		LIST_HEAD(free_list);
  1388		struct sk_buff *skb, *tmp;
  1389		void *end = data + len;
  1390		bool v3, wake = false;
  1391		u16 total, count = 0;
  1392		u32 txd = le32_to_cpu(free->txd);
  1393		u32 *cur_info;
  1394	
  1395		/* clean DMA queues and unmap buffers first */
  1396		mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_PSD], false);
  1397		mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_BE], false);
  1398		if (mphy_ext) {
  1399			mt76_queue_tx_cleanup(dev, mphy_ext->q_tx[MT_TXQ_PSD], false);
  1400			mt76_queue_tx_cleanup(dev, mphy_ext->q_tx[MT_TXQ_BE], false);
  1401		}
  1402	
  1403		/*
  1404		 * TODO: MT_TX_FREE_LATENCY is msdu time from the TXD is queued into PLE,
  1405		 * to the time ack is received or dropped by hw (air + hw queue time).
  1406		 * Should avoid accessing WTBL to get Tx airtime, and use it instead.
  1407		 */
  1408		total = FIELD_GET(MT_TX_FREE_MSDU_CNT, le16_to_cpu(free->ctrl));
  1409		v3 = (FIELD_GET(MT_TX_FREE_VER, txd) == 0x4);
  1410		if (WARN_ON_ONCE((void *)&free->info[total >> v3] > end))
  1411			return;
  1412	
> 1413		for (cur_info = &free->info[0]; count < total; cur_info++) {
  1414			u32 msdu, info = le32_to_cpu(*cur_info);
  1415			u8 i;
  1416	
  1417			/*
  1418			 * 1'b1: new wcid pair.
  1419			 * 1'b0: msdu_id with the same 'wcid pair' as above.
  1420			 */
  1421			if (info & MT_TX_FREE_PAIR) {
  1422				struct mt7915_sta *msta;
  1423				struct mt76_wcid *wcid;
  1424				u16 idx;
  1425	
  1426				idx = FIELD_GET(MT_TX_FREE_WLAN_ID, info);
  1427				wcid = rcu_dereference(dev->mt76.wcid[idx]);
  1428				sta = wcid_to_sta(wcid);
  1429				if (!sta)
  1430					continue;
  1431	
  1432				msta = container_of(wcid, struct mt7915_sta, wcid);
  1433				spin_lock_bh(&dev->sta_poll_lock);
  1434				if (list_empty(&msta->poll_list))
  1435					list_add_tail(&msta->poll_list, &dev->sta_poll_list);
  1436				spin_unlock_bh(&dev->sta_poll_lock);
  1437				continue;
  1438			}
  1439	
  1440			if (v3 && (info & MT_TX_FREE_MPDU_HEADER))
  1441				continue;
  1442	
  1443			for (i = 0; i < 1 + v3; i++) {
  1444				if (v3) {
  1445					msdu = (info >> (15 * i)) & MT_TX_FREE_MSDU_ID_V3;
  1446					if (msdu == MT_TX_FREE_MSDU_ID_V3)
  1447						continue;
  1448				} else {
  1449					msdu = FIELD_GET(MT_TX_FREE_MSDU_ID, info);
  1450				}
  1451				count++;
  1452				txwi = mt76_token_release(mdev, msdu, &wake);
  1453				if (!txwi)
  1454					continue;
  1455	
  1456				mt7915_txwi_free(dev, txwi, sta, &free_list);
  1457			}
  1458		}
  1459	
  1460		mt7915_mac_sta_poll(dev);
  1461	
  1462		if (wake)
  1463			mt76_set_tx_blocked(&dev->mt76, false);
  1464	
  1465		mt76_worker_schedule(&dev->mt76.tx_worker);
  1466	
  1467		list_for_each_entry_safe(skb, tmp, &free_list, list) {
  1468			skb_list_del_init(skb);
  1469			napi_consume_skb(skb, 1);
  1470		}
  1471	}
  1472	

---
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