All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Guo Ren <guoren@linux.alibaba.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Sat, 22 Jul 2023 17:45:46 +0800	[thread overview]
Message-ID: <202307221725.bXxd5JSG-lkp@intel.com> (raw)

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

             reply	other threads:[~2023-07-22  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-22  9:45 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-24 23:33 [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

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=202307221725.bXxd5JSG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=guoren@linux.alibaba.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.