From: "Paul E. McKenney" <paulmck@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 1888/2633] kernel/rcu/refscale.c:479:3: warning: variable 'x' is uninitialized when used here
Date: Thu, 13 May 2021 10:48:03 -0700 [thread overview]
Message-ID: <20210513174803.GC975577@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <202105121916.mj2oXShS-lkp@intel.com>
On Wed, May 12, 2021 at 07:38:22PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: ec85c95b0c90a17413901b018e8ade7b9eae7cad
> commit: 4b46fcb7f1a6a202e3f77ce377079b4243d1be6f [1888/2633] refscale: Add measurement of clock readout
> config: riscv-randconfig-r022-20210512 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install riscv cross compiling tool for clang build
> # apt-get install binutils-riscv64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4b46fcb7f1a6a202e3f77ce377079b4243d1be6f
> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git fetch --no-tags linux-next master
> git checkout 4b46fcb7f1a6a202e3f77ce377079b4243d1be6f
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> kernel/rcu/refscale.c:479:3: warning: variable 'x' is uninitialized when used here [-Wuninitialized]
> x += ktime_get_real_fast_ns();
> ^
> kernel/rcu/refscale.c:474:7: note: initialize the variable 'x' to silence this warning
> u64 x;
> ^
> = 0
> kernel/rcu/refscale.c:492:3: warning: variable 'x' is uninitialized when used here [-Wuninitialized]
> x += ktime_get_real_fast_ns();
> ^
> kernel/rcu/refscale.c:487:7: note: initialize the variable 'x' to silence this warning
> u64 x;
> ^
> = 0
> 2 warnings generated.
>
> Kconfig warnings: (for reference only)
> WARNING: unmet direct dependencies detected for LOCKDEP
> Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
> Selected by
> - DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
Fixed by updated commit 210b2a9a9247 ("refscale: Add measurement of
clock readout").
Thanx, Paul
> vim +/x +479 kernel/rcu/refscale.c
>
> 471
> 472 static void ref_clock_section(const int nloops)
> 473 {
> 474 u64 x;
> 475 int i;
> 476
> 477 preempt_disable();
> 478 for (i = nloops; i >= 0; i--) {
> > 479 x += ktime_get_real_fast_ns();
> 480 }
> 481 preempt_enable();
> 482 stopopts = x;
> 483 }
> 484
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
prev parent reply other threads:[~2021-05-13 17:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 11:38 [linux-next:master 1888/2633] kernel/rcu/refscale.c:479:3: warning: variable 'x' is uninitialized when used here kernel test robot
2021-05-13 17:48 ` Paul E. McKenney [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=20210513174803.GC975577@paulmck-ThinkPad-P17-Gen-1 \
--to=paulmck@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.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).