linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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
@ 2021-11-12 18:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-11-12 18:39 UTC (permalink / raw)
  To: Russell King; +Cc: llvm, kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3399 bytes --]

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35220 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-12 18:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 18:39 [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 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;
as well as URLs for NNTP newsgroup(s).