public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [lunn:v5.17-rc8-mdio-c45 2/12] drivers/net/phy/phylink.c:2371:50: warning: variable 'prtad' is uninitialized when used here
Date: Sun, 3 Apr 2022 09:14:03 +0800	[thread overview]
Message-ID: <202204030904.n5cYsrRU-lkp@intel.com> (raw)

tree:   https://github.com/lunn/linux.git v5.17-rc8-mdio-c45
head:   21ffc4381ec731f5e9521dec8925c0089b14920b
commit: 3e1cf3cbc07f3be863192a3cbdfe2b5f8cb14cd5 [2/12] net: phylink: Convert to mdiobus_c45_{read|write}
config: x86_64-randconfig-a016 (https://download.01.org/0day-ci/archive/20220403/202204030904.n5cYsrRU-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c4a1b07d0979e7ff20d7d541af666d822d66b566)
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
        # https://github.com/lunn/linux/commit/3e1cf3cbc07f3be863192a3cbdfe2b5f8cb14cd5
        git remote add lunn https://github.com/lunn/linux.git
        git fetch --no-tags lunn v5.17-rc8-mdio-c45
        git checkout 3e1cf3cbc07f3be863192a3cbdfe2b5f8cb14cd5
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/phy/

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/phylink.c:2371:50: warning: variable 'prtad' is uninitialized when used here [-Wuninitialized]
                   return mdiobus_c45_write(pl->phydev->mdio.bus, prtad, devad,
                                                                  ^~~~~
   drivers/net/phy/phylink.c:2341:11: note: initialize the variable 'prtad' to silence this warning
           int prtad, devad;
                    ^
                     = 0
   1 warning generated.


vim +/prtad +2371 drivers/net/phy/phylink.c

  2336	
  2337	static int phylink_phy_write(struct phylink *pl, unsigned int phy_id,
  2338				     unsigned int reg, unsigned int val)
  2339	{
  2340		struct phy_device *phydev = pl->phydev;
  2341		int prtad, devad;
  2342	
  2343		if (mdio_phy_id_is_c45(phy_id)) {
  2344			prtad = mdio_phy_id_prtad(phy_id);
  2345			devad = mdio_phy_id_devad(phy_id);
  2346			return mdiobus_c45_write(pl->phydev->mdio.bus, prtad, devad,
  2347						 reg, val);
  2348		}
  2349	
  2350		if (phydev->is_c45) {
  2351			switch (reg) {
  2352			case MII_BMCR:
  2353			case MII_BMSR:
  2354			case MII_PHYSID1:
  2355			case MII_PHYSID2:
  2356				devad = __ffs(phydev->c45_ids.mmds_present);
  2357				break;
  2358			case MII_ADVERTISE:
  2359			case MII_LPA:
  2360				if (!(phydev->c45_ids.mmds_present & MDIO_DEVS_AN))
  2361					return -EINVAL;
  2362				devad = MDIO_MMD_AN;
  2363				if (reg == MII_ADVERTISE)
  2364					reg = MDIO_AN_ADVERTISE;
  2365				else
  2366					reg = MDIO_AN_LPA;
  2367				break;
  2368			default:
  2369				return -EINVAL;
  2370			}
> 2371			return mdiobus_c45_write(pl->phydev->mdio.bus, prtad, devad,
  2372						 reg, val);
  2373		}
  2374	
  2375		return mdiobus_write(phydev->mdio.bus, phy_id, reg, val);
  2376	}
  2377	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-03  1:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202204030904.n5cYsrRU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /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