[xilinx-xlnx:xlnx_rebase_v5.10 846/1969] drivers/net/ethernet/cadence/macb_main.c:4724:58: sparse: sparse: incorrect type in argument 1 (different base types)

kernel test robot lkp at intel.com
Sat Oct 2 07:46:18 PDT 2021


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head:   6f887a3e4f2e3a52b4591879f46a233a707b1ba3
commit: c316fb22dac927c3d91e5e1fe54c8e43c081ac7e [846/1969] net: macb: Use WOL via ARP
config: x86_64-randconfig-s022-20211001 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/Xilinx/linux-xlnx/commit/c316fb22dac927c3d91e5e1fe54c8e43c081ac7e
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.10
        git checkout c316fb22dac927c3d91e5e1fe54c8e43c081ac7e
        # 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 at intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/net/ethernet/cadence/macb_main.c:278:16: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] bottom @@     got restricted __le32 [usertype] @@
   drivers/net/ethernet/cadence/macb_main.c:278:16: sparse:     expected unsigned int [usertype] bottom
   drivers/net/ethernet/cadence/macb_main.c:278:16: sparse:     got restricted __le32 [usertype]
   drivers/net/ethernet/cadence/macb_main.c:280:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] top @@     got restricted __le16 [usertype] @@
   drivers/net/ethernet/cadence/macb_main.c:280:13: sparse:     expected unsigned short [usertype] top
   drivers/net/ethernet/cadence/macb_main.c:280:13: sparse:     got restricted __le16 [usertype]
   drivers/net/ethernet/cadence/macb_main.c:3091:39: sparse: sparse: restricted __be32 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3096:39: sparse: sparse: restricted __be32 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3101:40: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3101:69: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3123:20: sparse: sparse: restricted __be32 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3127:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [assigned] [usertype] w0 @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/cadence/macb_main.c:3127:20: sparse:     expected unsigned int [assigned] [usertype] w0
   drivers/net/ethernet/cadence/macb_main.c:3127:20: sparse:     got restricted __be32 [usertype] ip4src
   drivers/net/ethernet/cadence/macb_main.c:3137:20: sparse: sparse: restricted __be32 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3141:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [assigned] [usertype] w0 @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/cadence/macb_main.c:3141:20: sparse:     expected unsigned int [assigned] [usertype] w0
   drivers/net/ethernet/cadence/macb_main.c:3141:20: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/cadence/macb_main.c:3151:21: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3151:50: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3157:30: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3158:30: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3165:36: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3166:38: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3169:38: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     got restricted __be32 [usertype] ip4src
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 [usertype] psrc @@
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     expected unsigned short [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     got restricted __be16 [usertype] psrc
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 [usertype] pdst @@
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     expected unsigned short [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse:     got restricted __be16 [usertype] pdst
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3205:9: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     got restricted __be32 [usertype] ip4src
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 [usertype] psrc @@
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     expected unsigned short [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     got restricted __be16 [usertype] psrc
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 [usertype] pdst @@
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     expected unsigned short [usertype] val
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse:     got restricted __be16 [usertype] pdst
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be16
   drivers/net/ethernet/cadence/macb_main.c:3258:25: sparse: sparse: cast from restricted __be16
>> drivers/net/ethernet/cadence/macb_main.c:4724:58: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int const [usertype] *p @@     got restricted __be32 [noderef] __rcu * @@
   drivers/net/ethernet/cadence/macb_main.c:4724:58: sparse:     expected unsigned int const [usertype] *p
   drivers/net/ethernet/cadence/macb_main.c:4724:58: sparse:     got restricted __be32 [noderef] __rcu *
   drivers/net/ethernet/cadence/macb_main.c:4724:41: sparse: sparse: restricted __be32 degrades to integer
>> drivers/net/ethernet/cadence/macb_main.c:4724:50: sparse: sparse: dereference of noderef expression
>> drivers/net/ethernet/cadence/macb_main.c:4724:50: sparse: sparse: dereference of noderef expression

vim +4724 drivers/net/ethernet/cadence/macb_main.c

  4681	
  4682	static int __maybe_unused macb_suspend(struct device *dev)
  4683	{
  4684		struct net_device *netdev = dev_get_drvdata(dev);
  4685		struct macb *bp = netdev_priv(netdev);
  4686		struct macb_queue *queue = bp->queues;
  4687		unsigned long flags;
  4688		unsigned int q;
  4689		u32 ctrl, arpipmask;
  4690	
  4691		if (!netif_running(netdev))
  4692			return 0;
  4693	
  4694		if (device_may_wakeup(&bp->dev->dev)) {
  4695			spin_lock_irqsave(&bp->lock, flags);
  4696			ctrl = macb_readl(bp, NCR);
  4697			ctrl &= ~(MACB_BIT(TE) | MACB_BIT(RE));
  4698			macb_writel(bp, NCR, ctrl);
  4699			/* Tie off RX queues */
  4700			for (q = 0, queue = bp->queues; q < bp->num_queues;
  4701			     ++q, ++queue) {
  4702				queue_writel(queue, RBQP,
  4703					     lower_32_bits(bp->rx_ring_tieoff_dma));
  4704			}
  4705			ctrl = macb_readl(bp, NCR);
  4706			ctrl |= MACB_BIT(RE);
  4707			macb_writel(bp, NCR, ctrl);
  4708			gem_writel(bp, NCFGR, gem_readl(bp, NCFGR) & ~MACB_BIT(NBC));
  4709			macb_writel(bp, TSR, -1);
  4710			macb_writel(bp, RSR, -1);
  4711			macb_readl(bp, ISR);
  4712			if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
  4713				macb_writel(bp, ISR, -1);
  4714	
  4715			/* Enable WOL (Q0 only) and disable all other interrupts */
  4716			macb_writel(bp, IER, MACB_BIT(WOL));
  4717			for (q = 1, queue = bp->queues; q < bp->num_queues;
  4718			     ++q, ++queue) {
  4719				queue_writel(queue, IDR, bp->rx_intr_mask |
  4720							 MACB_TX_INT_FLAGS |
  4721							 MACB_BIT(HRESP));
  4722			}
  4723	
> 4724			arpipmask = cpu_to_be32p(&bp->dev->ip_ptr->ifa_list->ifa_local)
  4725						 & 0xFFFF;
  4726			gem_writel(bp, WOL, MACB_BIT(ARP) | arpipmask);
  4727			spin_unlock_irqrestore(&bp->lock, flags);
  4728			enable_irq_wake(bp->queues[0].irq);
  4729			netif_device_detach(netdev);
  4730			for (q = 0, queue = bp->queues; q < bp->num_queues;
  4731			     ++q, ++queue)
  4732				napi_disable(&queue->napi);
  4733		}
  4734	
  4735		netif_device_detach(netdev);
  4736		for (q = 0, queue = bp->queues; q < bp->num_queues;
  4737		     ++q, ++queue)
  4738			napi_disable(&queue->napi);
  4739	
  4740		if (!device_may_wakeup(&bp->dev->dev)) {
  4741			rtnl_lock();
  4742			phylink_stop(bp->phylink);
  4743			rtnl_unlock();
  4744			spin_lock_irqsave(&bp->lock, flags);
  4745			macb_reset_hw(bp);
  4746			spin_unlock_irqrestore(&bp->lock, flags);
  4747		}
  4748	
  4749		if (!(bp->caps & MACB_CAPS_USRIO_DISABLED))
  4750			bp->pm_data.usrio = macb_or_gem_readl(bp, USRIO);
  4751	
  4752		if (netdev->hw_features & NETIF_F_NTUPLE)
  4753			bp->pm_data.scrt2 = gem_readl_n(bp, ETHT, SCRT2_ETHT);
  4754	
  4755		if (bp->ptp_info)
  4756			bp->ptp_info->ptp_remove(netdev);
  4757		if (!device_may_wakeup(dev))
  4758			pm_runtime_force_suspend(dev);
  4759	
  4760		return 0;
  4761	}
  4762	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36132 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211002/0d74b733/attachment-0001.gz>


More information about the linux-arm-kernel mailing list