tree:
https://github.com/linuxppc/linux next-test
head: b86acbffee8165a25d69876c37b0a1bab8e4f66d
commit: 887af0b0a569ff6f5af0ec24fcb1c6cde264a18a [146/147] powerpc/process: Remove useless
#ifdef CONFIG_SPE
config: powerpc-randconfig-r005-20200911 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
0a5dc7effb191eff740e0e7ae7bd8e1f6bdb3ad9)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
git checkout 887af0b0a569ff6f5af0ec24fcb1c6cde264a18a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> arch/powerpc/kernel/process.c:1957:7: warning: variable
'val' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (cpu_has_feature(CPU_FTR_SPE)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/kernel/process.c:1979:18: note: uninitialized use occurs here
return put_user(val, (unsigned int __user *) adr);
^~~
arch/powerpc/include/asm/uaccess.h:90:40: note: expanded from macro 'put_user'
__put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
^
arch/powerpc/include/asm/uaccess.h:192:33: note: expanded from macro
'__put_user_check'
__typeof__(*(ptr)) __pu_val = (x); \
^
arch/powerpc/kernel/process.c:1957:3: note: remove the 'if' if its condition is
always false
if (cpu_has_feature(CPU_FTR_SPE)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/kernel/process.c:1954:18: note: initialize the variable 'val' to
silence this warning
unsigned int val;
^
= 0
1 warning generated.
#
https://github.com/linuxppc/linux/commit/887af0b0a569ff6f5af0ec24fcb1c6cd...
git remote add linuxppc
https://github.com/linuxppc/linux
git fetch --no-tags linuxppc next-test
git checkout 887af0b0a569ff6f5af0ec24fcb1c6cde264a18a
vim +1957 arch/powerpc/kernel/process.c
14cf11af6cf608 Paul Mackerras 2005-09-26 1951
14cf11af6cf608 Paul Mackerras 2005-09-26 1952 int get_fpexc_mode(struct task_struct
*tsk, unsigned long adr)
14cf11af6cf608 Paul Mackerras 2005-09-26 1953 {
14cf11af6cf608 Paul Mackerras 2005-09-26 1954 unsigned int val;
14cf11af6cf608 Paul Mackerras 2005-09-26 1955
887af0b0a569ff Christophe Leroy 2020-08-17 1956 if (tsk->thread.fpexc_mode &
PR_FP_EXC_SW_ENABLE) {
640e922501103a Joseph Myers 2013-12-10 @1957 if (cpu_has_feature(CPU_FTR_SPE)) {
640e922501103a Joseph Myers 2013-12-10 1958 /*
640e922501103a Joseph Myers 2013-12-10 1959 * When the sticky exception bits are
set
640e922501103a Joseph Myers 2013-12-10 1960 * directly by userspace, it must
call prctl
640e922501103a Joseph Myers 2013-12-10 1961 * with PR_GET_FPEXC (with
PR_FP_EXC_SW_ENABLE
640e922501103a Joseph Myers 2013-12-10 1962 * in the existing prctl settings)
or
640e922501103a Joseph Myers 2013-12-10 1963 * PR_SET_FPEXC (with
PR_FP_EXC_SW_ENABLE in
640e922501103a Joseph Myers 2013-12-10 1964 * the bits being set).
<fenv.h> functions
640e922501103a Joseph Myers 2013-12-10 1965 * saving and restoring the whole
640e922501103a Joseph Myers 2013-12-10 1966 * floating-point environment need to
do so
640e922501103a Joseph Myers 2013-12-10 1967 * anyway to restore the prctl
settings from
640e922501103a Joseph Myers 2013-12-10 1968 * the saved environment.
640e922501103a Joseph Myers 2013-12-10 1969 */
887af0b0a569ff Christophe Leroy 2020-08-17 1970 #ifdef CONFIG_SPE
640e922501103a Joseph Myers 2013-12-10 1971 tsk->thread.spefscr_last =
mfspr(SPRN_SPEFSCR);
14cf11af6cf608 Paul Mackerras 2005-09-26 1972 val = tsk->thread.fpexc_mode;
887af0b0a569ff Christophe Leroy 2020-08-17 1973 #endif
640e922501103a Joseph Myers 2013-12-10 1974 } else
5e14d21e3f28a4 Kumar Gala 2007-09-13 1975 return -EINVAL;
887af0b0a569ff Christophe Leroy 2020-08-17 1976 } else {
14cf11af6cf608 Paul Mackerras 2005-09-26 1977 val =
__unpack_fe01(tsk->thread.fpexc_mode);
887af0b0a569ff Christophe Leroy 2020-08-17 1978 }
14cf11af6cf608 Paul Mackerras 2005-09-26 1979 return put_user(val, (unsigned int
__user *) adr);
14cf11af6cf608 Paul Mackerras 2005-09-26 1980 }
14cf11af6cf608 Paul Mackerras 2005-09-26 1981
:::::: The code at line 1957 was first introduced by commit
:::::: 640e922501103aaf2e0abb4cf4de5d49fa8342f7 powerpc: fix exception clearing in e500
SPE float emulation
:::::: TO: Joseph Myers <joseph(a)codesourcery.com>
:::::: CC: Scott Wood <scottwood(a)freescale.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org