kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [vfio:mdev-v14 11/22] include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function
@ 2016-11-17  7:29 kbuild test robot
  2016-11-17 15:31 ` Alex Williamson
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2016-11-17  7:29 UTC (permalink / raw)
  To: Kirti Wankhede; +Cc: kbuild-all, kvm, Alex Williamson, Neo Jia

[-- Attachment #1: Type: text/plain, Size: 3783 bytes --]

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;
                  ^~~~~~~

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@goodmis.org>
:::::: CC: Ingo Molnar <mingo@elte.hu>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 21643 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [vfio:mdev-v14 11/22] include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function
  2016-11-17  7:29 [vfio:mdev-v14 11/22] include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function kbuild test robot
@ 2016-11-17 15:31 ` Alex Williamson
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Williamson @ 2016-11-17 15:31 UTC (permalink / raw)
  To: kbuild test robot; +Cc: Kirti Wankhede, kbuild-all, kvm, Neo Jia

On Thu, 17 Nov 2016 15:29:14 +0800
kbuild test robot <fengguang.wu@intel.com> 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@goodmis.org>
> :::::: CC: Ingo Molnar <mingo@elte.hu>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-17 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17  7:29 [vfio:mdev-v14 11/22] include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function kbuild test robot
2016-11-17 15:31 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).