[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202203010451.ORtLeJ28-lkp@intel.com>
Date: Tue, 1 Mar 2022 05:00:40 +0800
From: kernel test robot <lkp@...el.com>
To: wudaemon <wudaemon@....com>, davem@...emloft.net, kuba@...nel.org,
m.grzeschik@...gutronix.de, chenhao288@...ilicon.com, arnd@...db.de
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org, wudaemon@....com,
shenyang39@...wei.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: ksz884x: use time_before in netdev_open for
compatibility and remove static variable
Hi wudaemon,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on net/master soc/for-next linus/master v5.17-rc6 next-20220228]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/wudaemon/net-ksz884x-use-time_before-in-netdev_open-for-compatibility-and-remove-static-variable/20220301-003151
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b42a738e409b62f38a15ce7530e8290b00f823a4
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220301/202203010451.ORtLeJ28-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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/0day-ci/linux/commit/5db9da911f33045f8dd202d40c20530211b48af0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review wudaemon/net-ksz884x-use-time_before-in-netdev_open-for-compatibility-and-remove-static-variable/20220301-003151
git checkout 5db9da911f33045f8dd202d40c20530211b48af0
# 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=i386 SHELL=/bin/bash drivers/net/ethernet/micrel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/micrel/ksz884x.c:3216:6: warning: variable 'change' set but not used [-Wunused-but-set-variable]
int change = 0;
^
drivers/net/ethernet/micrel/ksz884x.c:5363:16: warning: unused variable 'next_jiffies' [-Wunused-variable]
unsigned long next_jiffies = 0;
^
>> drivers/net/ethernet/micrel/ksz884x.c:5430:20: error: use of undeclared identifier 'next_jiffies'
if (time_before(next_jiffies, jiffies))
^
>> drivers/net/ethernet/micrel/ksz884x.c:5430:20: error: use of undeclared identifier 'next_jiffies'
drivers/net/ethernet/micrel/ksz884x.c:5431:5: error: use of undeclared identifier 'next_jiffies'
next_jiffies = jiffies + HZ * 2;
^
drivers/net/ethernet/micrel/ksz884x.c:5433:5: error: use of undeclared identifier 'next_jiffies'
next_jiffies += HZ * 1;
^
drivers/net/ethernet/micrel/ksz884x.c:5434:31: error: use of undeclared identifier 'next_jiffies'
hw_priv->counter[i].time = next_jiffies;
^
2 warnings and 5 errors generated.
vim +/next_jiffies +5430 drivers/net/ethernet/micrel/ksz884x.c
5397
5398 /**
5399 * netdev_open - open network device
5400 * @dev: Network device.
5401 *
5402 * This function process the open operation of network device. This is caused
5403 * by the user command "ifconfig ethX up."
5404 *
5405 * Return 0 if successful; otherwise an error code indicating failure.
5406 */
5407 static int netdev_open(struct net_device *dev)
5408 {
5409 struct dev_priv *priv = netdev_priv(dev);
5410 struct dev_info *hw_priv = priv->adapter;
5411 struct ksz_hw *hw = &hw_priv->hw;
5412 struct ksz_port *port = &priv->port;
5413 int i;
5414 int p;
5415 int rc = 0;
5416
5417 priv->multicast = 0;
5418 priv->promiscuous = 0;
5419
5420 /* Reset device statistics. */
5421 memset(&dev->stats, 0, sizeof(struct net_device_stats));
5422 memset((void *) port->counter, 0,
5423 (sizeof(u64) * OID_COUNTER_LAST));
5424
5425 if (!(hw_priv->opened)) {
5426 rc = prepare_hardware(dev);
5427 if (rc)
5428 return rc;
5429 for (i = 0; i < hw->mib_port_cnt; i++) {
> 5430 if (time_before(next_jiffies, jiffies))
5431 next_jiffies = jiffies + HZ * 2;
5432 else
5433 next_jiffies += HZ * 1;
5434 hw_priv->counter[i].time = next_jiffies;
5435 hw->port_mib[i].state = media_disconnected;
5436 port_init_cnt(hw, i);
5437 }
5438 if (hw->ksz_switch)
5439 hw->port_mib[HOST_PORT].state = media_connected;
5440 else {
5441 hw_add_wol_bcast(hw);
5442 hw_cfg_wol_pme(hw, 0);
5443 hw_clr_wol_pme_status(&hw_priv->hw);
5444 }
5445 }
5446 port_set_power_saving(port, false);
5447
5448 for (i = 0, p = port->first_port; i < port->port_cnt; i++, p++) {
5449 /*
5450 * Initialize to invalid value so that link detection
5451 * is done.
5452 */
5453 hw->port_info[p].partner = 0xFF;
5454 hw->port_info[p].state = media_disconnected;
5455 }
5456
5457 /* Need to open the port in multiple device interfaces mode. */
5458 if (hw->dev_count > 1) {
5459 port_set_stp_state(hw, port->first_port, STP_STATE_SIMPLE);
5460 if (port->first_port > 0)
5461 hw_add_addr(hw, dev->dev_addr);
5462 }
5463
5464 port_get_link_speed(port);
5465 if (port->force_link)
5466 port_force_link_speed(port);
5467 else
5468 port_set_link_speed(port);
5469
5470 if (!(hw_priv->opened)) {
5471 hw_setup_intr(hw);
5472 hw_enable(hw);
5473 hw_ena_intr(hw);
5474
5475 if (hw->mib_port_cnt)
5476 ksz_start_timer(&hw_priv->mib_timer_info,
5477 hw_priv->mib_timer_info.period);
5478 }
5479
5480 hw_priv->opened++;
5481
5482 ksz_start_timer(&priv->monitor_timer_info,
5483 priv->monitor_timer_info.period);
5484
5485 priv->media_state = port->linked->state;
5486
5487 set_media_state(dev, media_connected);
5488 netif_start_queue(dev);
5489
5490 return 0;
5491 }
5492
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists