lkml.org 
[lkml]   [2021]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[rmk-arm:zii 88/102] drivers/net/dsa/mv88e6xxx/serdes-6352.c:116:6: error: variable 'err' is used uninitialized whenever 'if' condition is false
tree:   git://git.armlinux.org.uk/~rmk/linux-arm zii
head: 2f38af1897a020adf10ab01d8dc20ea8388b564d
commit: b53990e2eebb53cba059843e3c6e93b3b0c10c59 [88/102] net: dsa: mv88e6xxx: convert 88e6352 to phylink_pcs *EXPERIMENTAL*
config: arm-buildonly-randconfig-r002-20211112 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
git remote add rmk-arm git://git.armlinux.org.uk/~rmk/linux-arm
git fetch --no-tags rmk-arm zii
git checkout b53990e2eebb53cba059843e3c6e93b3b0c10c59
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/net/dsa/mv88e6xxx/serdes-6352.c:116:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (oldpage >= 0)
^~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/serdes-6352.c:120:53: note: uninitialized use occurs here
return marvell_c22_pcs_restore_page(mpcs, oldpage, err);
^~~
drivers/net/dsa/mv88e6xxx/serdes-6352.c:116:2: note: remove the 'if' if its condition is always true
if (oldpage >= 0)
^~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/serdes-6352.c:113:18: note: initialize the variable 'err' to silence this warning
int oldpage, err;
^
= 0
drivers/net/dsa/mv88e6xxx/serdes-6352.c:189:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (oldpage >= 0)
^~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/serdes-6352.c:193:53: note: uninitialized use occurs here
return marvell_c22_pcs_restore_page(mpcs, oldpage, err);
^~~
drivers/net/dsa/mv88e6xxx/serdes-6352.c:189:2: note: remove the 'if' if its condition is always true
if (oldpage >= 0)
^~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/serdes-6352.c:182:23: note: initialize the variable 'err' to silence this warning
int oldpage, adv, err;
^
= 0
2 errors generated.


vim +116 drivers/net/dsa/mv88e6xxx/serdes-6352.c

109
110 static int marvell_c22_pcs_modify(struct marvell_c22_pcs *mpcs, u8 reg,
111 u16 mask, u16 val)
112 {
113 int oldpage, err;
114
115 oldpage = marvell_c22_pcs_set_fiber_page(mpcs);
> 116 if (oldpage >= 0)
117 err = __mdiobus_modify(mpcs->mdio.bus, mpcs->mdio.addr,
118 reg, mask, val);
119
120 return marvell_c22_pcs_restore_page(mpcs, oldpage, err);
121 }
122

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-11-12 19:42    [W:0.031 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site