[radeon-alex:amd-staging-dkms-4.13 1335/2206] drivers/gpu/drm/radeon/radeon_kfd.c:1430:32: warning: cast to pointer from integer of different size

kbuild test robot fengguang.wu at intel.com
Fri Oct 20 08:13:39 UTC 2017


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-dkms-4.13
head:   2b14e1f4fded74b9efeb990869076cebb06d27ee
commit: b7f99b04c37bbf0a5690d87d460792633fa2a9fb [1335/2206] radeon_kfd.c copied
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout b7f99b04c37bbf0a5690d87d460792633fa2a9fb
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'get_pdd_from_buffer_object':
   drivers/gpu/drm/radeon/radeon_kfd.c:219:22: error: 'struct radeon_bo' has no member named 'pdd'; did you mean 'pid'?
     return mem->data2.bo->pdd;
                         ^~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'open_graphic_handle':
   drivers/gpu/drm/radeon/radeon_kfd.c:531:34: error: passing argument 1 of 'drm_gem_object_lookup' from incompatible pointer type [-Werror=incompatible-pointer-types]
     gem_obj = drm_gem_object_lookup(rdev->ddev, filp->private_data, handle);
                                     ^~~~
   In file included from drivers/gpu/drm/radeon/radeon.h:77:0,
                    from drivers/gpu/drm/radeon/radeon_kfd.c:27:
   include/drm/drm_gem.h:319:24: note: expected 'struct drm_file *' but argument is of type 'struct drm_device *'
    struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                           ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:531:46: warning: passing argument 2 of 'drm_gem_object_lookup' makes integer from pointer without a cast [-Wint-conversion]
     gem_obj = drm_gem_object_lookup(rdev->ddev, filp->private_data, handle);
                                                 ^~~~
   In file included from drivers/gpu/drm/radeon/radeon.h:77:0,
                    from drivers/gpu/drm/radeon/radeon_kfd.c:27:
   include/drm/drm_gem.h:319:24: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
    struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                           ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:531:12: error: too many arguments to function 'drm_gem_object_lookup'
     gem_obj = drm_gem_object_lookup(rdev->ddev, filp->private_data, handle);
               ^~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/radeon/radeon.h:77:0,
                    from drivers/gpu/drm/radeon/radeon_kfd.c:27:
   include/drm/drm_gem.h:319:24: note: declared here
    struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                           ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'map_bo_to_gpuvm':
   drivers/gpu/drm/radeon/radeon_kfd.c:1275:9: error: too many arguments to function 'ttm_bo_wait'
      ret = ttm_bo_wait(&bo->tbo, true, false, false);
            ^~~~~~~~~~~
   In file included from drivers/gpu/drm/radeon/radeon.h:71:0,
                    from drivers/gpu/drm/radeon/radeon_kfd.c:27:
   include/drm/ttm/ttm_bo_api.h:292:12: note: declared here
    extern int ttm_bo_wait(struct ttm_buffer_object *bo,
               ^~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1284:2: error: implicit declaration of function 'drm_free_large' [-Werror=implicit-function-declaration]
     drm_free_large(vm_bos);
     ^~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'write_config_static_mem':
   drivers/gpu/drm/radeon/radeon_kfd.c:1372:26: error: 'SH_STATIC_MEM_CONFIG__SWIZZLE_ENABLE__SHIFT' undeclared (first use in this function)
     reg = swizzle_enable << SH_STATIC_MEM_CONFIG__SWIZZLE_ENABLE__SHIFT |
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1372:26: note: each undeclared identifier is reported only once for each function it appears in
   drivers/gpu/drm/radeon/radeon_kfd.c:1373:19: error: 'SH_STATIC_MEM_CONFIG__ELEMENT_SIZE__SHIFT' undeclared (first use in this function)
      element_size << SH_STATIC_MEM_CONFIG__ELEMENT_SIZE__SHIFT |
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1374:19: error: 'SH_STATIC_MEM_CONFIG__INDEX_STRIDE__SHIFT' undeclared (first use in this function)
      index_stride << SH_STATIC_MEM_CONFIG__INDEX_STRIDE__SHIFT |
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1375:19: error: 'SH_STATIC_MEM_CONFIG__PRIVATE_MTYPE__SHIFT' undeclared (first use in this function)
      index_stride << SH_STATIC_MEM_CONFIG__PRIVATE_MTYPE__SHIFT;
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/radeon/radeon_kfd.c:27:0:
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'alloc_memory_of_scratch':
   drivers/gpu/drm/radeon/radeon_kfd.c:1386:9: error: 'SH_HIDDEN_PRIVATE_BASE_VMID' undeclared (first use in this function)
     WREG32(SH_HIDDEN_PRIVATE_BASE_VMID, va);
            ^
   drivers/gpu/drm/radeon/radeon.h:2528:44: note: in definition of macro 'WREG32'
    #define WREG32(reg, v) r100_mm_wreg(rdev, (reg), (v), false)
                                               ^~~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'alloc_memory_of_gpu':
   drivers/gpu/drm/radeon/radeon_kfd.c:1425:4: error: 'struct radeon_bo' has no member named 'pdd'; did you mean 'pid'?
     bo->pdd = pdd;
       ^~
   In file included from include/linux/printk.h:329:0,
                    from include/linux/kernel.h:13,
                    from include/linux/list.h:8,
                    from include/linux/module.h:9,
                    from drivers/gpu/drm/radeon/radeon_kfd.c:23:
>> drivers/gpu/drm/radeon/radeon_kfd.c:1430:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     pr_debug("Set BO to VA %p\n", (void *) va);
                                   ^
   include/linux/dynamic_debug.h:127:10: note: in definition of macro 'dynamic_pr_debug'
           ##__VA_ARGS__);  \
             ^~~~~~~~~~~
>> drivers/gpu/drm/radeon/radeon_kfd.c:1430:2: note: in expansion of macro 'pr_debug'
     pr_debug("Set BO to VA %p\n", (void *) va);
     ^~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'set_num_of_requests':
   drivers/gpu/drm/radeon/radeon_kfd.c:1623:29: error: 'ATC_ATS_DEBUG' undeclared (first use in this function)
     value = read_register(dev, ATC_ATS_DEBUG);
                                ^~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1624:12: error: 'NUM_REQUESTS_AT_ERR_MASK' undeclared (first use in this function)
     value &= ~NUM_REQUESTS_AT_ERR_MASK;
               ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1625:11: error: implicit declaration of function 'NUM_REQUESTS_AT_ERR' [-Werror=implicit-function-declaration]
     value |= NUM_REQUESTS_AT_ERR(num_of_req);
              ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'get_cu_info':
   drivers/gpu/drm/radeon/radeon_kfd.c:1633:24: error: storage size of 'rcu_info' isn't known
     struct radeon_cu_info rcu_info;
                           ^~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c:1638:16: error: 'struct radeon_asic' has no member named 'get_cu_info'
     if (rdev->asic->get_cu_info == NULL)
                   ^~
   drivers/gpu/drm/radeon/radeon_kfd.c:1642:12: error: 'struct radeon_asic' has no member named 'get_cu_info'
     rdev->asic->get_cu_info(rdev, &rcu_info);
               ^~
   drivers/gpu/drm/radeon/radeon_kfd.c:1633:24: warning: unused variable 'rcu_info' [-Wunused-variable]
     struct radeon_cu_info rcu_info;
                           ^~~~~~~~
   drivers/gpu/drm/radeon/radeon_kfd.c: In function 'get_pdd_from_buffer_object':
   drivers/gpu/drm/radeon/radeon_kfd.c:220:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   cc1: some warnings being treated as errors

vim +1430 drivers/gpu/drm/radeon/radeon_kfd.c

  1391	
  1392	static int alloc_memory_of_gpu(struct kgd_dev *kgd, uint64_t va, size_t size,
  1393			void *vm, struct kgd_mem **mem,
  1394			uint64_t *offset, void **kptr,
  1395			struct kfd_process_device *pdd, uint32_t flags)
  1396	{
  1397		struct radeon_device *rdev = (struct radeon_device *) kgd;
  1398		int ret;
  1399		struct radeon_bo_va *bo_va;
  1400		struct radeon_bo *bo;
  1401	
  1402		BUG_ON(kgd == NULL);
  1403		BUG_ON(size == 0);
  1404		BUG_ON(mem == NULL);
  1405		BUG_ON(vm == NULL);
  1406	
  1407		*mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL);
  1408		if (*mem == NULL) {
  1409			ret = -ENOMEM;
  1410			goto err;
  1411		}
  1412		mutex_init(&(*mem)->data2.lock);
  1413	
  1414		/* Allocate buffer object on VRAM */
  1415		ret = radeon_bo_create(rdev, size, PAGE_SIZE, false,
  1416					RADEON_GEM_DOMAIN_VRAM,
  1417					RADEON_GEM_NO_CPU_ACCESS, NULL, NULL, &bo);
  1418		if (ret != 0) {
  1419			pr_err("amdkfd: Failed to create BO object on VRAM. ret == %d\n",
  1420					ret);
  1421			goto err_bo_create;
  1422		}
  1423	
  1424		pr_debug("Created BO on VRAM with size %zu bytes\n", size);
> 1425		bo->pdd = pdd;
  1426		ret = add_bo_to_vm(rdev, va, vm, bo, &bo_va);
  1427		if (ret != 0)
  1428			goto err_map;
  1429	
> 1430		pr_debug("Set BO to VA %p\n", (void *) va);
  1431	
  1432		(*mem)->data2.bo = bo;
  1433		(*mem)->data2.bo_va = bo_va;
  1434		(*mem)->data2.mapped_to_gpu_memory = 0;
  1435	
  1436		return 0;
  1437	
  1438	err_map:
  1439		radeon_bo_unref(&bo);
  1440	err_bo_create:
  1441		kfree(*mem);
  1442	err:
  1443		return ret;
  1444	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 61136 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20171020/59926925/attachment-0001.gz>


More information about the dri-devel mailing list