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: Tue, 25 Jul 2023 07:33:48 +0800 [thread overview]
Message-ID: <202307250718.R40DjDII-lkp@intel.com> (raw)
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
next reply other threads:[~2023-07-24 23:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 23:33 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
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
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=202307250718.R40DjDII-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox