public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [csky-linux:sg2042-master-qspinlock-64ilp32_v3 16/42] arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2023-07-22  9:45 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-07-22  9:45 UTC (permalink / raw)
  To: Guo Ren; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/c-sky/csky-linux sg2042-master-qspinlock-64ilp32_v3
head:   7f9f76d36814ed6fcbca4c27a5d2ec3724c46add
commit: bf3d65e88214791eb913d50e7e876c590dc4ce09 [16/42] riscv: u64ilp32: Enable user space runtime switch
config: riscv-randconfig-r042-20230720 (https://download.01.org/0day-ci/archive/20230722/202307221725.bXxd5JSG-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230722/202307221725.bXxd5JSG-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307221725.bXxd5JSG-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/thread_info.h:141:2: note: expanded from macro 'test_thread_flag'
     141 |         test_ti_thread_flag(current_thread_info(), flag)
         |         ^
   arch/riscv/kernel/vdso.c:322:9: note: uninitialized use occurs here
     322 |         return ret;
         |                ^~~
   arch/riscv/kernel/vdso.c:309:2: note: remove the 'if' if its condition is always true
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     310 |                 ret = __setup_additional_pages(mm, bprm, uses_interp,
         | ~~~~~~~~~~~~~~~~
>> arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/thread_info.h:141:2: note: expanded from macro 'test_thread_flag'
     141 |         test_ti_thread_flag(current_thread_info(), flag)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/kernel/vdso.c:322:9: note: uninitialized use occurs here
     322 |         return ret;
         |                ^~~
   arch/riscv/kernel/vdso.c:309:6: note: remove the '&&' if its condition is always true
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/thread_info.h:141:2: note: expanded from macro 'test_thread_flag'
     141 |         test_ti_thread_flag(current_thread_info(), flag)
         |         ^
   arch/riscv/kernel/vdso.c:303:9: note: initialize the variable 'ret' to silence this warning
     303 |         int ret;
         |                ^
         |                 = 0
   2 warnings generated.


vim +309 arch/riscv/kernel/vdso.c

76d2a0493a17d4c Palmer Dabbelt 2017-07-10  297  
3092eb45637573c Guo Ren        2022-04-05  298  #ifdef CONFIG_COMPAT
3092eb45637573c Guo Ren        2022-04-05  299  int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
3092eb45637573c Guo Ren        2022-04-05  300  				       int uses_interp)
3092eb45637573c Guo Ren        2022-04-05  301  {
3092eb45637573c Guo Ren        2022-04-05  302  	struct mm_struct *mm = current->mm;
3092eb45637573c Guo Ren        2022-04-05  303  	int ret;
3092eb45637573c Guo Ren        2022-04-05  304  
3092eb45637573c Guo Ren        2022-04-05  305  	if (mmap_write_lock_killable(mm))
3092eb45637573c Guo Ren        2022-04-05  306  		return -EINTR;
3092eb45637573c Guo Ren        2022-04-05  307  
4613fb010928a1e Guo Ren        2023-05-31  308  #ifdef CONFIG_VDSO32
4613fb010928a1e Guo Ren        2023-05-31 @309  	if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
4613fb010928a1e Guo Ren        2023-05-31  310  		ret = __setup_additional_pages(mm, bprm, uses_interp,
4613fb010928a1e Guo Ren        2023-05-31  311  							&vdso32_info);
4613fb010928a1e Guo Ren        2023-05-31  312  #endif
4613fb010928a1e Guo Ren        2023-05-31  313  

:::::: The code at line 309 was first introduced by commit
:::::: 4613fb010928a1edfaef78e3ea7175807fdb3bb5 riscv: u64ilp32: Adjust vDSO kernel flow for 64ilp32 abi

:::::: TO: Guo Ren <guoren@linux.alibaba.com>
:::::: CC: Guo Ren <guoren@linux.alibaba.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [csky-linux:sg2042-master-qspinlock-64ilp32_v3 16/42] arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2023-07-24 23:33 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-07-24 23:33 UTC (permalink / raw)
  To: Guo Ren; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/c-sky/csky-linux sg2042-master-qspinlock-64ilp32_v3
head:   afe9d1bbe54feff432a2c25572304c06de598ec0
commit: 1727f1271e2e6d73c7cc2737a4f22e872789d9ad [16/42] riscv: u64ilp32: Enable user space runtime switch
config: riscv-randconfig-r011-20230724 (https://download.01.org/0day-ci/archive/20230725/202307250718.R40DjDII-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230725/202307250718.R40DjDII-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307250718.R40DjDII-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/thread_info.h:141:2: note: expanded from macro 'test_thread_flag'
     141 |         test_ti_thread_flag(current_thread_info(), flag)
         |         ^
   arch/riscv/kernel/vdso.c:322:9: note: uninitialized use occurs here
     322 |         return ret;
         |                ^~~
   arch/riscv/kernel/vdso.c:309:2: note: remove the 'if' if its condition is always true
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     310 |                 ret = __setup_additional_pages(mm, bprm, uses_interp,
         | ~~~~~~~~~~~~~~~~
>> arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/thread_info.h:141:2: note: expanded from macro 'test_thread_flag'
     141 |         test_ti_thread_flag(current_thread_info(), flag)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/kernel/vdso.c:322:9: note: uninitialized use occurs here
     322 |         return ret;
         |                ^~~
   arch/riscv/kernel/vdso.c:309:6: note: remove the '&&' if its condition is always true
     309 |         if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/thread_info.h:141:2: note: expanded from macro 'test_thread_flag'
     141 |         test_ti_thread_flag(current_thread_info(), flag)
         |         ^
   arch/riscv/kernel/vdso.c:303:9: note: initialize the variable 'ret' to silence this warning
     303 |         int ret;
         |                ^
         |                 = 0
   2 warnings generated.


vim +309 arch/riscv/kernel/vdso.c

76d2a0493a17d4 Palmer Dabbelt 2017-07-10  297  
3092eb45637573 Guo Ren        2022-04-05  298  #ifdef CONFIG_COMPAT
3092eb45637573 Guo Ren        2022-04-05  299  int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
3092eb45637573 Guo Ren        2022-04-05  300  				       int uses_interp)
3092eb45637573 Guo Ren        2022-04-05  301  {
3092eb45637573 Guo Ren        2022-04-05  302  	struct mm_struct *mm = current->mm;
3092eb45637573 Guo Ren        2022-04-05  303  	int ret;
3092eb45637573 Guo Ren        2022-04-05  304  
3092eb45637573 Guo Ren        2022-04-05  305  	if (mmap_write_lock_killable(mm))
3092eb45637573 Guo Ren        2022-04-05  306  		return -EINTR;
3092eb45637573 Guo Ren        2022-04-05  307  
fea3d07fbad0af Guo Ren        2023-05-31  308  #ifdef CONFIG_VDSO32
fea3d07fbad0af Guo Ren        2023-05-31 @309  	if (test_thread_flag(TIF_32BIT) && !test_thread_flag(TIF_64ILP32))
fea3d07fbad0af Guo Ren        2023-05-31  310  		ret = __setup_additional_pages(mm, bprm, uses_interp,
fea3d07fbad0af Guo Ren        2023-05-31  311  							&vdso32_info);
fea3d07fbad0af Guo Ren        2023-05-31  312  #endif
fea3d07fbad0af Guo Ren        2023-05-31  313  

:::::: The code at line 309 was first introduced by commit
:::::: fea3d07fbad0afbaa64bac1e849bdc298d4c06fb riscv: u64ilp32: Adjust vDSO kernel flow for 64ilp32 abi

:::::: TO: Guo Ren <guoren@linux.alibaba.com>
:::::: CC: Guo Ren <guoren@linux.alibaba.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2023-07-24 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-22  9:45 [csky-linux:sg2042-master-qspinlock-64ilp32_v3 16/42] arch/riscv/kernel/vdso.c:309:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-07-24 23:33 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox