netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>,
	Jose.Abreu@synopsys.com, andrew@lunn.ch, hkallweit1@gmail.com,
	linux@armlinux.org.uk, kuba@kernel.org, netdev@vger.kernel.org,
	peppe.cavallaro@st.com, alexandre.torgue@foss.st.com,
	davem@davemloft.net, mcoquelin.stm32@gmail.com
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH net-next v3 1/3] net: stmmac: split xPCS setup from mdio register
Date: Fri, 28 May 2021 00:39:43 +0800	[thread overview]
Message-ID: <202105280000.ho2F2BZD-lkp@intel.com> (raw)
In-Reply-To: <20210527092415.25205-2-michael.wei.hong.sit@intel.com>

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

Hi Michael,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Michael-Sit-Wei-Hong/Enable-2-5Gbps-speed-for-stmmac/20210527-173057
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 59c56342459a483d5e563ed8b5fdb77ab7622a73
config: x86_64-randconfig-r013-20210526 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6505c630407c5feec818f0bb1c284f9eeebf2071)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/00cb836e57c674c038314b655ec92243ac43dad9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Michael-Sit-Wei-Hong/Enable-2-5Gbps-speed-for-stmmac/20210527-173057
        git checkout 00cb836e57c674c038314b655ec92243ac43dad9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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/ethernet/stmicro/stmmac/stmmac_mdio.c:419:17: warning: variable 'found' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized]
           for (addr = 0; addr < max_addr; addr++) {
                          ^~~~~~~~~~~~~~~
   drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:429:7: note: uninitialized use occurs here
           if (!found) {
                ^~~~~
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:419:17: note: remove the condition if it is always true
           for (addr = 0; addr < max_addr; addr++) {
                          ^~~~~~~~~~~~~~~
   drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:402:33: note: initialize the variable 'found' to silence this warning
           int mode, max_addr, addr, found, ret;
                                          ^
                                           = 0
   1 warning generated.


vim +419 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c

   399	
   400	int stmmac_xpcs_setup(struct mii_bus *bus)
   401	{
   402		int mode, max_addr, addr, found, ret;
   403		struct net_device *ndev = bus->priv;
   404		struct mdio_xpcs_args *xpcs;
   405		struct stmmac_priv *priv;
   406	
   407		priv = netdev_priv(ndev);
   408		xpcs = &priv->hw->xpcs_args;
   409		mode = priv->plat->phy_interface;
   410		max_addr = PHY_MAX_ADDR;
   411	
   412		priv->hw->xpcs = mdio_xpcs_get_ops();
   413		if (!priv->hw->xpcs)
   414			return -ENODEV;
   415	
   416		/* Try to probe the XPCS by scanning all addresses. */
   417		xpcs->bus = bus;
   418	
 > 419		for (addr = 0; addr < max_addr; addr++) {
   420			xpcs->addr = addr;
   421	
   422			ret = stmmac_xpcs_probe(priv, xpcs, mode);
   423			if (!ret) {
   424				found = 1;
   425				break;
   426			}
   427		}
   428	
   429		if (!found) {
   430			dev_warn(priv->device, "No xPCS found\n");
   431			return -ENODEV;
   432		}
   433	
   434		return ret;
   435	}
   436	

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

  reply	other threads:[~2021-05-27 16:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  9:24 [PATCH net-next v3 0/3] Enable 2.5Gbps speed for stmmac Michael Sit Wei Hong
2021-05-27  9:24 ` [PATCH net-next v3 1/3] net: stmmac: split xPCS setup from mdio register Michael Sit Wei Hong
2021-05-27 16:39   ` kernel test robot [this message]
2021-05-27  9:24 ` [PATCH net-next v3 2/3] net: pcs: add 2500BASEX support for Intel mGbE controller Michael Sit Wei Hong
2021-05-27 23:26   ` Andrew Lunn
2021-05-28  1:57     ` Sit, Michael Wei Hong
2021-05-27  9:24 ` [PATCH net-next v3 3/3] net: stmmac: enable Intel mGbE 2.5Gbps link speed Michael Sit Wei Hong

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=202105280000.ho2F2BZD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=michael.wei.hong.sit@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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;
as well as URLs for NNTP newsgroup(s).