netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next:master 89/100] drivers/net/phy/motorcomm.c:58:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true
@ 2021-05-22 15:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-22 15:48 UTC (permalink / raw)
  To: Peter Geis; +Cc: kbuild-all, clang-built-linux, netdev

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   f5120f5998803a973b1d432ed2aa7e592527aa46
commit: 48e8c6f1612b3d2dccaea2285231def830cc5b8e [89/100] net: phy: add driver for Motorcomm yt8511 phy
config: arm-randconfig-r033-20210522 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e84a9b9bb3051c35dea993cdad7b3d2575638f85)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=48e8c6f1612b3d2dccaea2285231def830cc5b8e
        git remote add net-next https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
        git fetch --no-tags net-next master
        git checkout 48e8c6f1612b3d2dccaea2285231def830cc5b8e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

>> drivers/net/phy/motorcomm.c:58:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (oldpage < 0)
               ^~~~~~~~~~~
   drivers/net/phy/motorcomm.c:110:43: note: uninitialized use occurs here
           return phy_restore_page(phydev, oldpage, ret);
                                                    ^~~
   drivers/net/phy/motorcomm.c:58:2: note: remove the 'if' if its condition is always false
           if (oldpage < 0)
           ^~~~~~~~~~~~~~~~
   drivers/net/phy/motorcomm.c:54:9: note: initialize the variable 'ret' to silence this warning
           int ret, oldpage;
                  ^
                   = 0
>> drivers/net/phy/motorcomm.c:83:2: warning: variable 'ge' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
           default: /* leave everything alone in other modes */
           ^~~~~~~
   drivers/net/phy/motorcomm.c:87:85: note: uninitialized use occurs here
           ret = __phy_modify(phydev, YT8511_PAGE, (YT8511_DELAY_RX | YT8511_DELAY_GE_TX_EN), ge);
                                                                                              ^~
   drivers/net/phy/motorcomm.c:53:17: note: initialize the variable 'ge' to silence this warning
           unsigned int ge, fe;
                          ^
                           = 0
   2 warnings generated.


vim +58 drivers/net/phy/motorcomm.c

    50	
    51	static int yt8511_config_init(struct phy_device *phydev)
    52	{
    53		unsigned int ge, fe;
    54		int ret, oldpage;
    55	
    56		/* set clock mode to 125mhz */
    57		oldpage = phy_select_page(phydev, YT8511_EXT_CLK_GATE);
  > 58		if (oldpage < 0)
    59			goto err_restore_page;
    60	
    61		ret = __phy_modify(phydev, YT8511_PAGE, 0, YT8511_CLK_125M);
    62		if (ret < 0)
    63			goto err_restore_page;
    64	
    65		/* set rgmii delay mode */
    66		switch (phydev->interface) {
    67		case PHY_INTERFACE_MODE_RGMII:
    68			ge = YT8511_DELAY_GE_TX_DIS;
    69			fe = YT8511_DELAY_FE_TX_DIS;
    70			break;
    71		case PHY_INTERFACE_MODE_RGMII_RXID:
    72			ge = YT8511_DELAY_RX | YT8511_DELAY_GE_TX_DIS;
    73			fe = YT8511_DELAY_FE_TX_DIS;
    74			break;
    75		case PHY_INTERFACE_MODE_RGMII_TXID:
    76			ge = YT8511_DELAY_GE_TX_EN;
    77			fe = YT8511_DELAY_FE_TX_EN;
    78			break;
    79		case PHY_INTERFACE_MODE_RGMII_ID:
    80			ge = YT8511_DELAY_RX | YT8511_DELAY_GE_TX_EN;
    81			fe = YT8511_DELAY_FE_TX_EN;
    82			break;
  > 83		default: /* leave everything alone in other modes */
    84			break;
    85		}
    86	
    87		ret = __phy_modify(phydev, YT8511_PAGE, (YT8511_DELAY_RX | YT8511_DELAY_GE_TX_EN), ge);
    88		if (ret < 0)
    89			goto err_restore_page;
    90	
    91		/* fast ethernet delay is in a separate page */
    92		ret = __phy_write(phydev, YT8511_PAGE_SELECT, YT8511_EXT_DELAY_DRIVE);
    93		if (ret < 0)
    94			goto err_restore_page;
    95	
    96		ret = __phy_modify(phydev, YT8511_PAGE, YT8511_DELAY_FE_TX_EN, fe);
    97		if (ret < 0)
    98			goto err_restore_page;
    99	
   100		/* leave pll enabled in sleep */
   101		ret = __phy_write(phydev, YT8511_PAGE_SELECT, YT8511_EXT_SLEEP_CTRL);
   102		if (ret < 0)
   103			goto err_restore_page;
   104	
   105		ret = __phy_modify(phydev, YT8511_PAGE, 0, YT8511_PLLON_SLP);
   106		if (ret < 0)
   107			goto err_restore_page;
   108	
   109	err_restore_page:
   110		return phy_restore_page(phydev, oldpage, ret);
   111	}
   112	

---
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: 24578 bytes --]

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

only message in thread, other threads:[~2021-05-22 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 15:48 [net-next:master 89/100] drivers/net/phy/motorcomm.c:58:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true 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).