[vhost:config-endian 33/36] drivers/vdpa/vdpa_sim/vdpa_sim.c:335:21: 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/mst/vhost.git config-endian
head:   6aef2378a564fea8e69c0419d94dc3ad9b4b7a99
commit: 0cf222ef876b95893406eebe685e595d88de0950 [33/36] virtio_net: correct tags for config space fields
config: parisc-randconfig-s032-20200710 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.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.2-37-gc9676a3b-dirty
        git checkout 0cf222ef876b95893406eebe685e595d88de0950
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=parisc 

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/vdpa/vdpa_sim/vdpa_sim.c:335:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [usertype] mtu @@     got int @@
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:335:21: sparse:     expected restricted __virtio16 [usertype] mtu
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:335:21: sparse:     got int
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:336:24: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [usertype] status @@     got int @@
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:336:24: sparse:     expected restricted __virtio16 [usertype] status
   drivers/vdpa/vdpa_sim/vdpa_sim.c:336:24: sparse:     got int

vim +335 drivers/vdpa/vdpa_sim/vdpa_sim.c

2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  306  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  307  static struct vdpasim *vdpasim_create(void)
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  308  {
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  309  	struct virtio_net_config *config;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  310  	struct vdpasim *vdpasim;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  311  	struct device *dev;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  312  	int ret = -ENOMEM;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  313  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  314  	vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL,
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  315  				    &vdpasim_net_config_ops);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  316  	if (!vdpasim)
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  317  		goto err_alloc;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  318  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  319  	INIT_WORK(&vdpasim->work, vdpasim_work);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  320  	spin_lock_init(&vdpasim->lock);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  321  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  322  	dev = &vdpasim->vdpa.dev;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  323  	dev->coherent_dma_mask = DMA_BIT_MASK(64);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  324  	set_dma_ops(dev, &vdpasim_dma_ops);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  325  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  326  	vdpasim->iommu = vhost_iotlb_alloc(2048, 0);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  327  	if (!vdpasim->iommu)
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  328  		goto err_iommu;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  329  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  330  	vdpasim->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  331  	if (!vdpasim->buffer)
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  332  		goto err_iommu;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  333  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  334  	config = &vdpasim->config;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 @335  	config->mtu = 1500;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26 @336  	config->status = VIRTIO_NET_S_LINK_UP;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  337  	eth_random_addr(config->mac);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  338  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  339  	vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  340  	vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  341  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  342  	vdpasim->vdpa.dma_dev = dev;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  343  	ret = vdpa_register_device(&vdpasim->vdpa);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  344  	if (ret)
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  345  		goto err_iommu;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  346  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  347  	return vdpasim;
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  348  
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  349  err_iommu:
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  350  	put_device(dev);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  351  err_alloc:
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  352  	return ERR_PTR(ret);
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  353  }
2c53d0f64c06f4 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c Jason Wang 2020-03-26  354  

:::::: The code at line 335 was first introduced by commit
:::::: 2c53d0f64c06f4580588ef16f50f63a112117a02 vdpasim: vDPA device simulator

:::::: TO: Jason Wang <jasowang@xxxxxxxxxx>
:::::: CC: Michael S. Tsirkin <mst@xxxxxxxxxx>

---
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]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux