[linux-next:master 15563/15831] drivers/vdpa/virtio_pci/vp_vdpa.c:418:42: sparse: sparse: incorrect type in assignment (different address spaces)

[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:   9a9aa07ae18be3b77ba132a6eff3a92c9b83e016
commit: 11d8ffed00b231356008b35a3b0bc192e42333fa [15563/15831] vp_vdpa: switch to use vp_modern_map_vq_notify()
config: x86_64-randconfig-s022-20210504 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=11d8ffed00b231356008b35a3b0bc192e42333fa
        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 11d8ffed00b231356008b35a3b0bc192e42333fa
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64 

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/virtio_pci/vp_vdpa.c:418:42: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *notify @@     got void * @@
   drivers/vdpa/virtio_pci/vp_vdpa.c:418:42: sparse:     expected void [noderef] __iomem *notify
   drivers/vdpa/virtio_pci/vp_vdpa.c:418:42: sparse:     got void *

vim +418 drivers/vdpa/virtio_pci/vp_vdpa.c

   366	
   367	static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
   368	{
   369		struct virtio_pci_modern_device *mdev;
   370		struct device *dev = &pdev->dev;
   371		struct vp_vdpa *vp_vdpa;
   372		int ret, i;
   373	
   374		ret = pcim_enable_device(pdev);
   375		if (ret)
   376			return ret;
   377	
   378		vp_vdpa = vdpa_alloc_device(struct vp_vdpa, vdpa,
   379					    dev, &vp_vdpa_ops, NULL);
   380		if (vp_vdpa == NULL) {
   381			dev_err(dev, "vp_vdpa: Failed to allocate vDPA structure\n");
   382			return -ENOMEM;
   383		}
   384	
   385		mdev = &vp_vdpa->mdev;
   386		mdev->pci_dev = pdev;
   387	
   388		ret = vp_modern_probe(mdev);
   389		if (ret) {
   390			dev_err(&pdev->dev, "Failed to probe modern PCI device\n");
   391			goto err;
   392		}
   393	
   394		pci_set_master(pdev);
   395		pci_set_drvdata(pdev, vp_vdpa);
   396	
   397		vp_vdpa->vdpa.dma_dev = &pdev->dev;
   398		vp_vdpa->queues = vp_modern_get_num_queues(mdev);
   399	
   400		ret = devm_add_action_or_reset(dev, vp_vdpa_free_irq_vectors, pdev);
   401		if (ret) {
   402			dev_err(&pdev->dev,
   403				"Failed for adding devres for freeing irq vectors\n");
   404			goto err;
   405		}
   406	
   407		vp_vdpa->vring = devm_kcalloc(&pdev->dev, vp_vdpa->queues,
   408					      sizeof(*vp_vdpa->vring),
   409					      GFP_KERNEL);
   410		if (!vp_vdpa->vring) {
   411			ret = -ENOMEM;
   412			dev_err(&pdev->dev, "Fail to allocate virtqueues\n");
   413			goto err;
   414		}
   415	
   416		for (i = 0; i < vp_vdpa->queues; i++) {
   417			vp_vdpa->vring[i].irq = VIRTIO_MSI_NO_VECTOR;
 > 418			vp_vdpa->vring[i].notify = vp_modern_map_vq_notify(mdev, i);
   419			if (!vp_vdpa->vring[i].notify) {
   420				dev_warn(&pdev->dev, "Fail to map vq notify %d\n", i);
   421				goto err;
   422			}
   423		}
   424		vp_vdpa->config_irq = VIRTIO_MSI_NO_VECTOR;
   425	
   426		ret = vdpa_register_device(&vp_vdpa->vdpa, vp_vdpa->queues);
   427		if (ret) {
   428			dev_err(&pdev->dev, "Failed to register to vdpa bus\n");
   429			goto err;
   430		}
   431	
   432		return 0;
   433	
   434	err:
   435		put_device(&vp_vdpa->vdpa.dev);
   436		return ret;
   437	}
   438	

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