[radeon-alex:amd-mainline-dkms-5.2 2080/3212] include/kcl/kcl_kref.h:9:21: warning: passing argument 1 of 'atomic_read' from incompatible pointer type

kbuild test robot lkp at intel.com
Mon Dec 9 00:56:28 UTC 2019


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-5.2
head:   d269e78d6ce76b6e78f9dad26f336745130b2bfa
commit: b35c23a557bb753b64082a4aa4057374bcbcca74 [2080/3212] drm/amdkcl: Test whether kref_read() function is available
config: x86_64-randconfig-a002-20191206 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        git checkout b35c23a557bb753b64082a4aa4057374bcbcca74
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   include/kcl/kcl_mm.h:75:21: error: redefinition of 'kvzalloc'
    static inline void *kvzalloc(size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:643:21: note: previous definition of 'kvzalloc' was here
    static inline void *kvzalloc(size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:85:20: error: static declaration of 'kvfree' follows non-static declaration
    static inline void kvfree(const void *addr)
                       ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:663:13: note: previous declaration of 'kvfree' was here
    extern void kvfree(const void *addr);
                ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:105:21: error: redefinition of 'kvmalloc_array'
    static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:648:21: note: previous definition of 'kvmalloc_array' was here
    static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:118:21: error: redefinition of 'kvcalloc'
    static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:658:21: note: previous definition of 'kvcalloc' was here
    static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:9:0,
                    from <command-line>:0:
   include/kcl/kcl_fence.h:161:20: error: redefinition of 'dma_fence_set_error'
    static inline void dma_fence_set_error(struct dma_fence *fence,
                       ^
   In file included from include/drm/drmP.h:58:0,
                    from include/kcl/kcl_drm.h:6,
                    from drivers/gpu/drm/ttm/backport/backport.h:6,
                    from <command-line>:0:
   include/linux/dma-fence.h:517:20: note: previous definition of 'dma_fence_set_error' was here
    static inline void dma_fence_set_error(struct dma_fence *fence,
                       ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:9:0,
                    from <command-line>:0:
   include/kcl/kcl_fence.h: In function 'dma_fence_set_error':
   include/kcl/kcl_fence.h:167:7: error: 'struct dma_fence' has no member named 'status'
     fence->status = error;
          ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:10:0,
                    from <command-line>:0:
   include/kcl/kcl_list.h: At top level:
   include/kcl/kcl_list.h:6:20: error: redefinition of 'list_bulk_move_tail'
    static inline void list_bulk_move_tail(struct list_head *head,
                       ^
   In file included from include/linux/preempt.h:11:0,
                    from include/linux/rcupdate.h:27,
                    from include/linux/rbtree.h:34,
                    from include/drm/drm_mm.h:41,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/list.h:212:20: note: previous definition of 'list_bulk_move_tail' was here
    static inline void list_bulk_move_tail(struct list_head *head,
                       ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0,
                    from <command-line>:0:
   include/kcl/kcl_kref.h:7:28: error: redefinition of 'kref_read'
    static inline unsigned int kref_read(const struct kref *kref)
                               ^
   In file included from include/linux/kobject.h:23:0,
                    from include/linux/device.h:16,
                    from include/drm/drm_print.h:32,
                    from include/drm/drm_mm.h:49,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/kref.h:36:28: note: previous definition of 'kref_read' was here
    static inline unsigned int kref_read(const struct kref *kref)
                               ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0,
                    from <command-line>:0:
   include/kcl/kcl_kref.h: In function 'kref_read':
>> include/kcl/kcl_kref.h:9:21: warning: passing argument 1 of 'atomic_read' from incompatible pointer type
     return atomic_read(&kref->refcount);
                        ^
   In file included from arch/x86/include/asm/atomic.h:265:0,
                    from include/linux/atomic.h:7,
                    from include/linux/rcupdate.h:25,
                    from include/linux/rbtree.h:34,
                    from include/drm/drm_mm.h:41,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const struct atomic_t *' but argument is of type 'const struct refcount_t *'
    atomic_read(const atomic_t *v)
    ^
   cc1: some warnings being treated as errors
--
   include/kcl/kcl_mm.h:75:21: error: redefinition of 'kvzalloc'
    static inline void *kvzalloc(size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:643:21: note: previous definition of 'kvzalloc' was here
    static inline void *kvzalloc(size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:85:20: error: static declaration of 'kvfree' follows non-static declaration
    static inline void kvfree(const void *addr)
                       ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:663:13: note: previous declaration of 'kvfree' was here
    extern void kvfree(const void *addr);
                ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:105:21: error: redefinition of 'kvmalloc_array'
    static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:648:21: note: previous definition of 'kvmalloc_array' was here
    static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:118:21: error: redefinition of 'kvcalloc'
    static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:658:21: note: previous definition of 'kvcalloc' was here
    static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:9:0,
                    from <command-line>:0:
   include/kcl/kcl_fence.h:161:20: error: redefinition of 'dma_fence_set_error'
    static inline void dma_fence_set_error(struct dma_fence *fence,
                       ^
   In file included from include/drm/drmP.h:58:0,
                    from include/kcl/kcl_drm.h:6,
                    from drivers/gpu/drm/ttm/backport/backport.h:6,
                    from <command-line>:0:
   include/linux/dma-fence.h:517:20: note: previous definition of 'dma_fence_set_error' was here
    static inline void dma_fence_set_error(struct dma_fence *fence,
                       ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:9:0,
                    from <command-line>:0:
   include/kcl/kcl_fence.h: In function 'dma_fence_set_error':
   include/kcl/kcl_fence.h:167:7: error: 'struct dma_fence' has no member named 'status'
     fence->status = error;
          ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:10:0,
                    from <command-line>:0:
   include/kcl/kcl_list.h: At top level:
   include/kcl/kcl_list.h:6:20: error: redefinition of 'list_bulk_move_tail'
    static inline void list_bulk_move_tail(struct list_head *head,
                       ^
   In file included from include/linux/preempt.h:11:0,
                    from include/linux/rcupdate.h:27,
                    from include/linux/rbtree.h:34,
                    from include/drm/drm_mm.h:41,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/list.h:212:20: note: previous definition of 'list_bulk_move_tail' was here
    static inline void list_bulk_move_tail(struct list_head *head,
                       ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0,
                    from <command-line>:0:
   include/kcl/kcl_kref.h:7:28: error: redefinition of 'kref_read'
    static inline unsigned int kref_read(const struct kref *kref)
                               ^
   In file included from include/linux/kobject.h:23:0,
                    from include/linux/device.h:16,
                    from include/drm/drm_print.h:32,
                    from include/drm/drm_mm.h:49,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/kref.h:36:28: note: previous definition of 'kref_read' was here
    static inline unsigned int kref_read(const struct kref *kref)
                               ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0,
                    from <command-line>:0:
   include/kcl/kcl_kref.h: In function 'kref_read':
>> include/kcl/kcl_kref.h:9:21: warning: passing argument 1 of 'atomic_read' from incompatible pointer type
     return atomic_read(&kref->refcount);
                        ^
   In file included from arch/x86/include/asm/atomic.h:265:0,
                    from include/linux/atomic.h:7,
                    from include/linux/rcupdate.h:25,
                    from include/linux/rbtree.h:34,
                    from include/drm/drm_mm.h:41,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const struct atomic_t *' but argument is of type 'const struct refcount_t *'
    atomic_read(const atomic_t *v)
    ^
   drivers/gpu/drm/ttm/ttm_bo.c: In function 'ttm_bo_mem_space_debug':
   drivers/gpu/drm/ttm/ttm_bo.c:101:9: error: invalid initializer
     struct drm_printer p = drm_debug_printer(TTM_PFX);
            ^
   cc1: some warnings being treated as errors
--
   include/kcl/kcl_mm.h:75:21: error: redefinition of 'kvzalloc'
    static inline void *kvzalloc(size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:643:21: note: previous definition of 'kvzalloc' was here
    static inline void *kvzalloc(size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:85:20: error: static declaration of 'kvfree' follows non-static declaration
    static inline void kvfree(const void *addr)
                       ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:663:13: note: previous declaration of 'kvfree' was here
    extern void kvfree(const void *addr);
                ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:105:21: error: redefinition of 'kvmalloc_array'
    static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:648:21: note: previous definition of 'kvmalloc_array' was here
    static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:8:0,
                    from <command-line>:0:
   include/kcl/kcl_mm.h:118:21: error: redefinition of 'kvcalloc'
    static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from include/drm/drm_vma_manager.h:27:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/mm.h:658:21: note: previous definition of 'kvcalloc' was here
    static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                        ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:9:0,
                    from <command-line>:0:
   include/kcl/kcl_fence.h:161:20: error: redefinition of 'dma_fence_set_error'
    static inline void dma_fence_set_error(struct dma_fence *fence,
                       ^
   In file included from include/drm/drmP.h:58:0,
                    from include/kcl/kcl_drm.h:6,
                    from drivers/gpu/drm/ttm/backport/backport.h:6,
                    from <command-line>:0:
   include/linux/dma-fence.h:517:20: note: previous definition of 'dma_fence_set_error' was here
    static inline void dma_fence_set_error(struct dma_fence *fence,
                       ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:9:0,
                    from <command-line>:0:
   include/kcl/kcl_fence.h: In function 'dma_fence_set_error':
   include/kcl/kcl_fence.h:167:7: error: 'struct dma_fence' has no member named 'status'
     fence->status = error;
          ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:10:0,
                    from <command-line>:0:
   include/kcl/kcl_list.h: At top level:
   include/kcl/kcl_list.h:6:20: error: redefinition of 'list_bulk_move_tail'
    static inline void list_bulk_move_tail(struct list_head *head,
                       ^
   In file included from include/linux/preempt.h:11:0,
                    from include/linux/rcupdate.h:27,
                    from include/linux/rbtree.h:34,
                    from include/drm/drm_mm.h:41,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/list.h:212:20: note: previous definition of 'list_bulk_move_tail' was here
    static inline void list_bulk_move_tail(struct list_head *head,
                       ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0,
                    from <command-line>:0:
   include/kcl/kcl_kref.h:7:28: error: redefinition of 'kref_read'
    static inline unsigned int kref_read(const struct kref *kref)
                               ^
   In file included from include/linux/kobject.h:23:0,
                    from include/linux/device.h:16,
                    from include/drm/drm_print.h:32,
                    from include/drm/drm_mm.h:49,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/linux/kref.h:36:28: note: previous definition of 'kref_read' was here
    static inline unsigned int kref_read(const struct kref *kref)
                               ^
   In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0,
                    from <command-line>:0:
   include/kcl/kcl_kref.h: In function 'kref_read':
>> include/kcl/kcl_kref.h:9:21: warning: passing argument 1 of 'atomic_read' from incompatible pointer type
     return atomic_read(&kref->refcount);
                        ^
   In file included from arch/x86/include/asm/atomic.h:265:0,
                    from include/linux/atomic.h:7,
                    from include/linux/rcupdate.h:25,
                    from include/linux/rbtree.h:34,
                    from include/drm/drm_mm.h:41,
                    from include/drm/drm_vma_manager.h:26,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const struct atomic_t *' but argument is of type 'const struct refcount_t *'
    atomic_read(const atomic_t *v)
    ^
   drivers/gpu/drm/ttm/ttm_bo_manager.c: In function 'ttm_bo_man_debug':
   drivers/gpu/drm/ttm/ttm_bo_manager.c:145:26: warning: passing argument 2 of 'drm_mm_print' from incompatible pointer type
     drm_mm_print(&rman->mm, printer);
                             ^
   In file included from include/drm/drm_vma_manager.h:26:0,
                    from include/kcl/kcl_drm_vma_manager.h:8,
                    from drivers/gpu/drm/ttm/backport/backport.h:5,
                    from <command-line>:0:
   include/drm/drm_mm.h:547:6: note: expected 'struct drm_printer *' but argument is of type 'struct drm_printer *'
    void drm_mm_print(const struct drm_mm *mm, struct drm_printer *p);
         ^
   cc1: some warnings being treated as errors

vim +/atomic_read +9 include/kcl/kcl_kref.h

     5	
     6	#if !defined(HAVE_KREF_READ)
     7	static inline unsigned int kref_read(const struct kref *kref)
     8	{
   > 9		return atomic_read(&kref->refcount);
    10	}
    11	#endif
    12	

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


More information about the dri-devel mailing list