Re: [vfio:mdev-v14 11/22] include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function

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

 



On Thu, 17 Nov 2016 15:29:14 +0800
kbuild test robot <fengguang.wu@xxxxxxxxx> wrote:

> tree:   https://github.com/awilliam/linux-vfio.git mdev-v14
> head:   4e00cd8f5f2bb527739c118ecef7618cba91ad8f
> commit: 08328e6c0af2193e06343641ab48efa95bcd9e24 [11/22] vfio iommu: Add blocking notifier to notify DMA_UNMAP
> config: x86_64-randconfig-s2-11171425 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         git checkout 08328e6c0af2193e06343641ab48efa95bcd9e24
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> 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/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/compat.h:8,
>                     from drivers/vfio/vfio_iommu_type1.c:27:
>    drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_type1_ioctl':
> >> include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function [-Wmaybe-uninitialized]  
>        ______r = likely_notrace(x);   \
>                ^
>    drivers/vfio/vfio_iommu_type1.c:784:15: note: 'retries' was declared here
>      int ret = 0, retries;
>                   ^~~~~~~

Sort of impossible since retries is initialized when (dma != dma_last),
where dma_last is initialized to NULL, but I'll go ahead and add a zero
initializer to retries to make this happy.  Thanks,

Alex

> 
> vim +/retries +125 include/linux/compiler.h
> 
> d9ad8bc0 Bart Van Assche 2009-04-05  109      && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
> 2ed84eeb Steven Rostedt  2008-11-12  110  void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
> 1f0d69a9 Steven Rostedt  2008-11-12  111  
> 1f0d69a9 Steven Rostedt  2008-11-12  112  #define likely_notrace(x)	__builtin_expect(!!(x), 1)
> 1f0d69a9 Steven Rostedt  2008-11-12  113  #define unlikely_notrace(x)	__builtin_expect(!!(x), 0)
> 1f0d69a9 Steven Rostedt  2008-11-12  114  
> 45b79749 Steven Rostedt  2008-11-21  115  #define __branch_check__(x, expect) ({					\
> 1f0d69a9 Steven Rostedt  2008-11-12  116  			int ______r;					\
> 2ed84eeb Steven Rostedt  2008-11-12  117  			static struct ftrace_branch_data		\
> 1f0d69a9 Steven Rostedt  2008-11-12  118  				__attribute__((__aligned__(4)))		\
> 45b79749 Steven Rostedt  2008-11-21  119  				__attribute__((section("_ftrace_annotated_branch"))) \
> 1f0d69a9 Steven Rostedt  2008-11-12  120  				______f = {				\
> 1f0d69a9 Steven Rostedt  2008-11-12  121  				.func = __func__,			\
> 1f0d69a9 Steven Rostedt  2008-11-12  122  				.file = __FILE__,			\
> 1f0d69a9 Steven Rostedt  2008-11-12  123  				.line = __LINE__,			\
> 1f0d69a9 Steven Rostedt  2008-11-12  124  			};						\
> 1f0d69a9 Steven Rostedt  2008-11-12 @125  			______r = likely_notrace(x);			\
> 45b79749 Steven Rostedt  2008-11-21  126  			ftrace_likely_update(&______f, ______r, expect); \
> 1f0d69a9 Steven Rostedt  2008-11-12  127  			______r;					\
> 1f0d69a9 Steven Rostedt  2008-11-12  128  		})
> 1f0d69a9 Steven Rostedt  2008-11-12  129  
> 1f0d69a9 Steven Rostedt  2008-11-12  130  /*
> 1f0d69a9 Steven Rostedt  2008-11-12  131   * Using __builtin_constant_p(x) to ignore cases where the return
> 1f0d69a9 Steven Rostedt  2008-11-12  132   * value is always the same.  This idea is taken from a similar patch
> 1f0d69a9 Steven Rostedt  2008-11-12  133   * written by Daniel Walker.
> 
> :::::: The code at line 125 was first introduced by commit
> :::::: 1f0d69a9fc815db82f15722bf05227190b1d714d tracing: profile likely and unlikely annotations
> 
> :::::: TO: Steven Rostedt <rostedt@xxxxxxxxxxx>
> :::::: CC: Ingo Molnar <mingo@xxxxxxx>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux