[intel-gvt-linux:gvt-next-fixes 1/2] drivers/gpu/drm/i915/gvt/kvmgt.c:671:21: sparse: incorrect type in assignment (different address spaces)

kbuild test robot fengguang.wu at intel.com
Fri Feb 2 13:25:41 UTC 2018


tree:   https://github.com/intel/gvt-linux gvt-next-fixes
head:   9c965528f2d84c8c88e7728105af20c4d869f1e2
commit: acf52f5c17e71bf6a3854f9437b679d3fd77ab4e [1/2] drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on
reproduce:
        # apt-get install sparse
        git checkout acf52f5c17e71bf6a3854f9437b679d3fd77ab4e
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/i915/gvt/kvmgt.c:671:21: sparse: incorrect type in assignment (different address spaces) @@ expected void @@ got void <avoid @@
   drivers/gpu/drm/i915/gvt/kvmgt.c:671:21: expected void
   drivers/gpu/drm/i915/gvt/kvmgt.c:671:21: got void
>> drivers/gpu/drm/i915/gvt/kvmgt.c:682:26: sparse: incorrect type in argument 1 (different address spaces) @@ expected void @@ got @@
   drivers/gpu/drm/i915/gvt/kvmgt.c:682:26: expected void
   drivers/gpu/drm/i915/gvt/kvmgt.c:682:26: got void

vim +671 drivers/gpu/drm/i915/gvt/kvmgt.c

   659	
   660	static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, uint64_t off,
   661			void *buf, unsigned long count, bool is_write)
   662	{
   663		void *aperture_va;
   664	
   665		if (!intel_vgpu_in_aperture(vgpu, off) ||
   666		    !intel_vgpu_in_aperture(vgpu, off + count)) {
   667			gvt_vgpu_err("Invalid aperture offset %llu\n", off);
   668			return -EINVAL;
   669		}
   670	
 > 671		aperture_va = io_mapping_map_wc(&vgpu->gvt->dev_priv->ggtt.iomap,
   672						ALIGN_DOWN(off, PAGE_SIZE),
   673						count + offset_in_page(off));
   674		if (!aperture_va)
   675			return -EIO;
   676	
   677		if (is_write)
   678			memcpy(aperture_va + offset_in_page(off), buf, count);
   679		else
   680			memcpy(buf, aperture_va + offset_in_page(off), count);
   681	
 > 682		io_mapping_unmap(aperture_va);
   683	
   684		return 0;
   685	}
   686	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the intel-gvt-dev mailing list