[mmotm:master 409/499] drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:319:54: sparse: Using plain integer as NULL pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   1055821ba3c83218cbba4481f8349e3326cdaa32
commit: 20fbd93e7b438ae1deea44a4ae632edaab7cee0b [409/499] include/asm-generic/ioctl.h: fix _IOC_TYPECHECK sparse error
reproduce: make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:319:54: sparse: Using plain integer as NULL pointer
--
>> drivers/gpu/drm/drm_ioc32.c:460:17: sparse: cast removes address space of expression
>> drivers/gpu/drm/drm_ioc32.c:460:14: sparse: incorrect type in assignment (different address spaces)
   drivers/gpu/drm/drm_ioc32.c:460:14:    expected struct drm_buf_desc [noderef] <asn:1>*list
   drivers/gpu/drm/drm_ioc32.c:460:14:    got struct drm_buf_desc *<noident>
>> drivers/gpu/drm/drm_ioc32.c:521:17: sparse: cast removes address space of expression
>> drivers/gpu/drm/drm_ioc32.c:521:14: sparse: incorrect type in assignment (different address spaces)
   drivers/gpu/drm/drm_ioc32.c:521:14:    expected struct drm_buf_pub [noderef] <asn:1>*list
   drivers/gpu/drm/drm_ioc32.c:521:14:    got struct drm_buf_pub *<noident>
>> drivers/gpu/drm/drm_ioc32.c:1019:20: sparse: symbol 'drm_compat_ioctls' was not declared. Should it be static?
--
>> drivers/gpu/drm/drm_drv.c:276:37: sparse: incorrect type in argument 1 (different address spaces)
   drivers/gpu/drm/drm_drv.c:276:37:    expected char *buf
   drivers/gpu/drm/drm_drv.c:276:37:    got char [noderef] <asn:1>*name
>> drivers/gpu/drm/drm_drv.c:279:45: sparse: incorrect type in argument 1 (different address spaces)
   drivers/gpu/drm/drm_drv.c:279:45:    expected char *buf
   drivers/gpu/drm/drm_drv.c:279:45:    got char [noderef] <asn:1>*date
>> drivers/gpu/drm/drm_drv.c:282:45: sparse: incorrect type in argument 1 (different address spaces)
   drivers/gpu/drm/drm_drv.c:282:45:    expected char *buf
   drivers/gpu/drm/drm_drv.c:282:45:    got char [noderef] <asn:1>*desc
>> drivers/gpu/drm/drm_drv.c:251:34: sparse: incorrect type in argument 1 (different address spaces)
   drivers/gpu/drm/drm_drv.c:251:34:    expected void [noderef] <asn:1>*to
   drivers/gpu/drm/drm_drv.c:251:34:    got char *buf

Please consider folding the attached diff :-)

vim +319 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

e2fa3a76 Thomas Hellstrom 2011-10-04  303  
4b9e45e6 Thomas Hellstrom 2013-10-10  304  	/*
4b9e45e6 Thomas Hellstrom 2013-10-10  305  	 * Create the bo as pinned, so that a tryreserve will
4b9e45e6 Thomas Hellstrom 2013-10-10  306  	 * immediately succeed. This is because we're the only
4b9e45e6 Thomas Hellstrom 2013-10-10  307  	 * user of the bo currently.
4b9e45e6 Thomas Hellstrom 2013-10-10  308  	 */
4b9e45e6 Thomas Hellstrom 2013-10-10  309  	ret = ttm_bo_create(&dev_priv->bdev,
4b9e45e6 Thomas Hellstrom 2013-10-10  310  			    PAGE_SIZE,
4b9e45e6 Thomas Hellstrom 2013-10-10  311  			    ttm_bo_type_device,
4b9e45e6 Thomas Hellstrom 2013-10-10  312  			    &vmw_sys_ne_placement,
4b9e45e6 Thomas Hellstrom 2013-10-10  313  			    0, false, NULL,
4b9e45e6 Thomas Hellstrom 2013-10-10  314  			    &bo);
4b9e45e6 Thomas Hellstrom 2013-10-10  315  
e2fa3a76 Thomas Hellstrom 2011-10-04  316  	if (unlikely(ret != 0))
4b9e45e6 Thomas Hellstrom 2013-10-10  317  		return ret;
4b9e45e6 Thomas Hellstrom 2013-10-10  318  
4b9e45e6 Thomas Hellstrom 2013-10-10 @319  	ret = ttm_bo_reserve(bo, false, true, false, 0);
4b9e45e6 Thomas Hellstrom 2013-10-10  320  	BUG_ON(ret != 0);
e2fa3a76 Thomas Hellstrom 2011-10-04  321  
e2fa3a76 Thomas Hellstrom 2011-10-04  322  	ret = ttm_bo_kmap(bo, 0, 1, &map);
e2fa3a76 Thomas Hellstrom 2011-10-04  323  	if (likely(ret == 0)) {
e2fa3a76 Thomas Hellstrom 2011-10-04  324  		result = ttm_kmap_obj_virtual(&map, &dummy);
e2fa3a76 Thomas Hellstrom 2011-10-04  325  		result->totalSize = sizeof(*result);
e2fa3a76 Thomas Hellstrom 2011-10-04  326  		result->state = SVGA3D_QUERYSTATE_PENDING;
e2fa3a76 Thomas Hellstrom 2011-10-04  327  		result->result32 = 0xff;

:::::: The code at line 319 was first introduced by commit
:::::: 4b9e45e68ff9ccd241fa61f9eff1cbddabc05ea1 drm/vmwgfx: Ditch the vmw_dummy_query_bo_prepare function

:::::: TO: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
:::::: CC: Thomas Hellstrom <thellstrom@xxxxxxxxxx>

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
From: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Subject: [PATCH mmotm] include/asm-generic/ioctl.h: drm_compat_ioctls[] can be static
TO: Hans Verkuil <hverkuil@xxxxxxxxx>
CC: Johannes Weiner <hannes@xxxxxxxxxxx>
CC: dri-devel@xxxxxxxxxxxxxxxxxxxxx 
CC: linux-kernel@xxxxxxxxxxxxxxx 

CC: Hans Verkuil <hverkuil@xxxxxxxxx>
CC: Johannes Weiner <hannes@xxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
 drm_ioc32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 2f4c4343..aa8bbb4 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -1016,7 +1016,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
 	return 0;
 }
 
-drm_ioctl_compat_t *drm_compat_ioctls[] = {
+static drm_ioctl_compat_t *drm_compat_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version,
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE32)] = compat_drm_getunique,
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_MAP32)] = compat_drm_getmap,

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]