[drm:drm-syncobj 8/8] include/linux/dma-fence.h:194:5: warning: 'old_fence' may be used uninitialized in this function

kbuild test robot fengguang.wu at intel.com
Wed Apr 12 05:30:06 UTC 2017


tree:   git://people.freedesktop.org/~airlied/linux.git drm-syncobj
head:   58ec426a9ee099705987657cfad202b5bd96e363
commit: 58ec426a9ee099705987657cfad202b5bd96e363 [8/8] amdgpu: use sync file for shared semaphores (v3)
config: i386-randconfig-x075-201715 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 58ec426a9ee099705987657cfad202b5bd96e363
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from include/drm/drmP.h:60:0,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:28:
   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_ioctl':
>> include/linux/dma-fence.h:194:5: warning: 'old_fence' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (fence)
        ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1033:20: note: 'old_fence' was declared here
     struct dma_fence *old_fence;
                       ^~~~~~~~~
--
   In file included from include/drm/drmP.h:60:0,
                    from drivers/gpu//drm/amd/amdgpu/amdgpu_cs.c:28:
   drivers/gpu//drm/amd/amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_ioctl':
>> include/linux/dma-fence.h:194:5: warning: 'old_fence' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (fence)
        ^
   drivers/gpu//drm/amd/amdgpu/amdgpu_cs.c:1033:20: note: 'old_fence' was declared here
     struct dma_fence *old_fence;
                       ^~~~~~~~~

vim +/old_fence +194 include/linux/dma-fence.h

f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  178  	void (*timeline_value_str)(struct dma_fence *fence,
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  179  				   char *str, int size);
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  180  };
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  181  
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  182  void dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
76bf0db5 include/linux/fence.h     Christian K├Ânig   2016-06-01  183  		    spinlock_t *lock, u64 context, unsigned seqno);
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  184  
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  185  void dma_fence_release(struct kref *kref);
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  186  void dma_fence_free(struct dma_fence *fence);
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  187  
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  188  /**
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  189   * dma_fence_put - decreases refcount of the fence
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29  190   * @fence:	[in]	fence to reduce refcount of
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29  191   */
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  192  static inline void dma_fence_put(struct dma_fence *fence)
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29  193  {
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29 @194  	if (fence)
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  195  		kref_put(&fence->refcount, dma_fence_release);
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29  196  }
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29  197  
4be05420 include/linux/fence.h     Chris Wilson      2016-08-29  198  /**
f54d1867 include/linux/dma-fence.h Chris Wilson      2016-10-25  199   * dma_fence_get - increases refcount of the fence
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  200   * @fence:	[in]	fence to increase refcount of
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  201   *
e941759c include/linux/fence.h     Maarten Lankhorst 2014-07-01  202   * Returns the same fence, with refcount increased by 1.

:::::: The code at line 194 was first introduced by commit
:::::: 4be0542073a33cc063b6a8f8fb367536e234e7aa dma-buf: Introduce fence_get_rcu_safe()

:::::: TO: Chris Wilson <chris at chris-wilson.co.uk>
:::::: CC: Sumit Semwal <sumit.semwal at linaro.org>

---
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: 28144 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170412/42d7369d/attachment-0001.gz>


More information about the dri-devel mailing list