[radeon-alex:raven 340/1060] drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'

kbuild test robot fengguang.wu at intel.com
Tue Jun 13 22:34:29 UTC 2017


tree:   git://people.freedesktop.org/~agd5f/linux.git raven
head:   c6ee08eda872bc7ac60ed0ba82a5d85e696a894c
commit: a1146cea5877c42e10858082cf9018fd63165a92 [340/1060] drm/amdgpu: handle CPU access for split VRAM buffers (v2)
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout a1146cea5877c42e10858082cf9018fd63165a92
        # save the attached .config to linux build tree
        make.cross ARCH=parisc 

All error/warnings (new ones prefixed by >>):

   In file included from ./arch/parisc/include/generated/asm/div64.h:1:0,
                    from include/linux/kernel.h:149,
                    from include/linux/list.h:8,
                    from include/drm/drm_hashtab.h:38,
                    from include/drm/ttm/ttm_bo_api.h:34,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:32:
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_io_mem_pfn':
   include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast
     (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                               ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'
     page_offset = do_div(offset, size);
                   ^~~~~~
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/list.h:4,
                    from include/drm/drm_hashtab.h:38,
                    from include/drm/ttm/ttm_bo_api.h:34,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:32:
   include/asm-generic/div64.h:220:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     } else if (likely(((n) >> 32) == 0)) {  \
                            ^
   include/linux/compiler.h:178:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'
     page_offset = do_div(offset, size);
                   ^~~~~~
   In file included from ./arch/parisc/include/generated/asm/div64.h:1:0,
                    from include/linux/kernel.h:149,
                    from include/linux/list.h:8,
                    from include/drm/drm_hashtab.h:38,
                    from include/drm/ttm/ttm_bo_api.h:34,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:32:
>> include/asm-generic/div64.h:224:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
      __rem = __div64_32(&(n), __base); \
                         ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'
     page_offset = do_div(offset, size);
                   ^~~~~~
   include/asm-generic/div64.h:198:17: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'long unsigned int *'
    extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
                    ^~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from ./arch/parisc/include/generated/asm/div64.h:1:0,
                    from include/linux/kernel.h:149,
                    from include/linux/list.h:8,
                    from include/drm/drm_hashtab.h:38,
                    from include/drm/ttm/ttm_bo_api.h:34,
                    from drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c:32:
   drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_io_mem_pfn':
   include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast
     (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                               ^
   drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'
     page_offset = do_div(offset, size);
                   ^~~~~~
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/list.h:4,
                    from include/drm/drm_hashtab.h:38,
                    from include/drm/ttm/ttm_bo_api.h:34,
                    from drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c:32:
   include/asm-generic/div64.h:220:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     } else if (likely(((n) >> 32) == 0)) {  \
                            ^
   include/linux/compiler.h:178:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'
     page_offset = do_div(offset, size);
                   ^~~~~~
   In file included from ./arch/parisc/include/generated/asm/div64.h:1:0,
                    from include/linux/kernel.h:149,
                    from include/linux/list.h:8,
                    from include/drm/drm_hashtab.h:38,
                    from include/drm/ttm/ttm_bo_api.h:34,
                    from drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c:32:
>> include/asm-generic/div64.h:224:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
      __rem = __div64_32(&(n), __base); \
                         ^
   drivers/gpu//drm/amd/amdgpu/amdgpu_ttm.c:556:16: note: in expansion of macro 'do_div'
     page_offset = do_div(offset, size);
                   ^~~~~~
   include/asm-generic/div64.h:198:17: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'long unsigned int *'
    extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
                    ^~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/do_div +556 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

   540			return -EINVAL;
   541		}
   542		return 0;
   543	}
   544	
   545	static void amdgpu_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
   546	{
   547	}
   548	
   549	static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo,
   550						   unsigned long page_offset)
   551	{
   552		struct drm_mm_node *mm = bo->mem.mm_node;
   553		uint64_t size = mm->size;
   554		unsigned long offset = page_offset;
   555	
 > 556		page_offset = do_div(offset, size);
   557		return (bo->mem.bus.base >> PAGE_SHIFT) + mm->start + page_offset;
   558	}
   559	
   560	/*
   561	 * TTM backend functions.
   562	 */
   563	struct amdgpu_ttm_gup_task_list {
   564		struct list_head	list;

---
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: 49271 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170614/73480c1b/attachment-0001.gz>


More information about the dri-devel mailing list