[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212060001.oBGIiZj2-lkp@intel.com>
Date: Tue, 6 Dec 2022 01:01:26 +0800
From: kernel test robot <lkp@...el.com>
To: Mengyuan Lou <mengyuanlou@...-swift.com>, netdev@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
jiawenwu@...stnetic.com, Mengyuan Lou <mengyuanlou@...-swift.com>
Subject: Re: [PATCH net-next] net: ngbe: Add mdio bus driver.
Hi Mengyuan,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Mengyuan-Lou/net-ngbe-Add-mdio-bus-driver/20221202-163942
patch link: https://lore.kernel.org/r/20221202083558.57618-1-mengyuanlou%40net-swift.com
patch subject: [PATCH net-next] net: ngbe: Add mdio bus driver.
config: x86_64-allyesconfig
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/intel-lab-lkp/linux/commit/a7134823ef0f61487a2f41e5cc684f70a6f1f6f6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Mengyuan-Lou/net-ngbe-Add-mdio-bus-driver/20221202-163942
git checkout a7134823ef0f61487a2f41e5cc684f70a6f1f6f6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/ drivers/net/ethernet/wangxun/ngbe/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c:284:2: warning: variable 'lan_speed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c:287:39: note: uninitialized use occurs here
wr32m(wxhw, NGBE_CFG_LAN_SPEED, 0x3, lan_speed);
^~~~~~~~~
drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c:258:15: note: initialize the variable 'lan_speed' to silence this warning
u32 lan_speed, reg;
^
= 0
1 warning generated.
vim +/lan_speed +284 drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
251
252 static void ngbe_handle_link_change(struct net_device *dev)
253 {
254 struct ngbe_adapter *adapter = netdev_priv(dev);
255 struct ngbe_hw *hw = &adapter->hw;
256 struct wx_hw *wxhw = &hw->wxhw;
257 bool changed = false;
258 u32 lan_speed, reg;
259
260 struct phy_device *phydev = hw->phydev;
261
262 if (hw->link != phydev->link ||
263 hw->speed != phydev->speed ||
264 hw->duplex != phydev->duplex) {
265 changed = true;
266 hw->link = phydev->link;
267 hw->speed = phydev->speed;
268 hw->duplex = phydev->duplex;
269 }
270
271 if (!changed)
272 return;
273
274 switch (phydev->speed) {
275 case SPEED_1000:
276 lan_speed = 2;
277 break;
278 case SPEED_100:
279 lan_speed = 1;
280 break;
281 case SPEED_10:
282 lan_speed = 0;
283 break;
> 284 default:
285 break;
286 }
287 wr32m(wxhw, NGBE_CFG_LAN_SPEED, 0x3, lan_speed);
288
289 if (phydev->link) {
290 if (phydev->speed & (SPEED_1000 | SPEED_100 | SPEED_10)) {
291 reg = rd32(wxhw, WX_MAC_TX_CFG);
292 reg &= ~WX_MAC_TX_CFG_SPEED_MASK;
293 reg |= WX_MAC_TX_CFG_SPEED_1G | WX_MAC_TX_CFG_TE;
294 wr32(wxhw, WX_MAC_TX_CFG, reg);
295 }
296 /* Re configure MAC RX */
297 reg = rd32(wxhw, WX_MAC_RX_CFG);
298 wr32(wxhw, WX_MAC_RX_CFG, reg);
299 wr32(wxhw, WX_MAC_PKT_FLT, WX_MAC_PKT_FLT_PR);
300 reg = rd32(wxhw, WX_MAC_WDG_TIMEOUT);
301 wr32(wxhw, WX_MAC_WDG_TIMEOUT, reg);
302 }
303 phy_print_status(phydev);
304 }
305
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (286624 bytes)
Powered by blists - more mailing lists