linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 1888/2633] kernel/rcu/refscale.c:479:3: warning: variable 'x' is uninitialized when used here
@ 2021-05-12 11:38 kernel test robot
  2021-05-13 17:48 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-05-12 11:38 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: kbuild-all, clang-built-linux, Linux Memory Management List

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

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


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

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

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

* Re: [linux-next:master 1888/2633] kernel/rcu/refscale.c:479:3: warning: variable 'x' is uninitialized when used here
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2021-05-13 17:48 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, clang-built-linux, Linux Memory Management List

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




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

end of thread, other threads:[~2021-05-13 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).