From: Alex Williamson <alex.williamson@redhat.com>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: Kirti Wankhede <kwankhede@nvidia.com>,
kbuild-all@01.org, kvm@vger.kernel.org, Neo Jia <cjia@nvidia.com>
Subject: Re: [vfio:mdev-v14 11/22] include/linux/compiler.h:125:12: warning: 'retries' may be used uninitialized in this function
Date: Thu, 17 Nov 2016 08:31:24 -0700 [thread overview]
Message-ID: <20161117083124.5775f5e8@t450s.home> (raw)
In-Reply-To: <201611171506.Gtlc5CVD%fengguang.wu@intel.com>
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
prev parent reply other threads:[~2016-11-17 18:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161117083124.5775f5e8@t450s.home \
--to=alex.williamson@redhat.com \
--cc=cjia@nvidia.com \
--cc=fengguang.wu@intel.com \
--cc=kbuild-all@01.org \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).