lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210040343.EViWYqIM-lkp@intel.com>
Date:   Tue, 4 Oct 2022 03:07:17 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jiri Pirko <jiri@...dia.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [jpirko-mlxsw:jiri_devel_devlink_locking 6/21]
 drivers/net/ethernet/mscc/ocelot_vsc7514.c:380:37: warning: variable
 'ocelot_port' set but not used

tree:   https://github.com/jpirko/linux_mlxsw jiri_devel_devlink_locking
head:   be08093f142da8feeb66f179d543343bc961d866
commit: 593662e2085a8bd69ebb3f6ba4815f5999486675 [6/21] net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port
config: ia64-allyesconfig
compiler: ia64-linux-gcc (GCC) 12.1.0
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/jpirko/linux_mlxsw/commit/593662e2085a8bd69ebb3f6ba4815f5999486675
        git remote add jpirko-mlxsw https://github.com/jpirko/linux_mlxsw
        git fetch --no-tags jpirko-mlxsw jiri_devel_devlink_locking
        git checkout 593662e2085a8bd69ebb3f6ba4815f5999486675
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/net/ethernet/mscc/

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/mscc/ocelot_vsc7514.c: In function 'mscc_ocelot_init_ports':
>> drivers/net/ethernet/mscc/ocelot_vsc7514.c:380:37: warning: variable 'ocelot_port' set but not used [-Wunused-but-set-variable]
     380 |                 struct ocelot_port *ocelot_port;
         |                                     ^~~~~~~~~~~
   {standard input}: Assembler messages:
   {standard input}:314: Error: Register number out of range 0..2
   {standard input}:316: Error: Register number out of range 0..2
   {standard input}:316: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 39
   {standard input}:316: Warning: Only the first path encountering the conflict is reported
   {standard input}:314: Warning: This is the location of the conflicting usage
   {standard input}:317: Error: Register number out of range 0..2
   {standard input}:317: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 39
   {standard input}:317: Warning: Only the first path encountering the conflict is reported
   {standard input}:314: Warning: This is the location of the conflicting usage
   {standard input}:317: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 39
   {standard input}:317: Warning: Only the first path encountering the conflict is reported
   {standard input}:316: Warning: This is the location of the conflicting usage
   {standard input}:318: Error: Register number out of range 0..2
   {standard input}:318: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 39
   {standard input}:318: Warning: Only the first path encountering the conflict is reported
   {standard input}:314: Warning: This is the location of the conflicting usage
   {standard input}:318: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 39
   {standard input}:318: Warning: Only the first path encountering the conflict is reported
   {standard input}:316: Warning: This is the location of the conflicting usage
   {standard input}:318: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 39
   {standard input}:318: Warning: Only the first path encountering the conflict is reported
   {standard input}:317: Warning: This is the location of the conflicting usage
   {standard input}:322: Error: Register number out of range 0..2
   {standard input}:704: Error: Register number out of range 0..5
   {standard input}:708: Error: Register number out of range 0..5
   {standard input}:924: Error: Register number out of range 0..1
   {standard input}:925: Error: Register number out of range 0..1
   {standard input}:925: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:924: Warning: This is the location of the conflicting usage
   {standard input}:927: Error: Register number out of range 0..1
   {standard input}:927: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:924: Warning: This is the location of the conflicting usage
   {standard input}:927: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:925: Warning: This is the location of the conflicting usage
   {standard input}:928: Error: Register number out of range 0..1
   {standard input}:928: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:924: Warning: This is the location of the conflicting usage
   {standard input}:928: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:925: Warning: This is the location of the conflicting usage
   {standard input}:928: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:927: Warning: This is the location of the conflicting usage
   {standard input}:929: Error: Register number out of range 0..1
   {standard input}:929: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:924: Warning: This is the location of the conflicting usage
   {standard input}:929: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:925: Warning: This is the location of the conflicting usage
   {standard input}:929: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:927: Warning: This is the location of the conflicting usage
   {standard input}:929: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
   {standard input}:928: Warning: This is the location of the conflicting usage
   {standard input}:933: Error: Register number out of range 0..1
   {standard input}:1427: Error: Register number out of range 0..4
   {standard input}:1428: Error: Register number out of range 0..4
   {standard input}:1428: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 49
   {standard input}:1428: Warning: Only the first path encountering the conflict is reported
   {standard input}:1427: Warning: This is the location of the conflicting usage
   {standard input}:1432: Error: Register number out of range 0..4
   {standard input}:2469: Error: Register number out of range 0..6


vim +/ocelot_port +380 drivers/net/ethernet/mscc/ocelot_vsc7514.c

22cdb493de54ca Vladimir Oltean 2020-09-18  357  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  358  static int mscc_ocelot_init_ports(struct platform_device *pdev,
7c411799e1b3e0 Vladimir Oltean 2020-09-18  359  				  struct device_node *ports)
7c411799e1b3e0 Vladimir Oltean 2020-09-18  360  {
7c411799e1b3e0 Vladimir Oltean 2020-09-18  361  	struct ocelot *ocelot = platform_get_drvdata(pdev);
e0c16233577fb8 Dan Carpenter   2021-02-02  362  	u32 devlink_ports_registered = 0;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  363  	struct device_node *portnp;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  364  	int port, err;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  365  	u32 reg;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  366  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  367  	ocelot->ports = devm_kcalloc(ocelot->dev, ocelot->num_phys_ports,
7c411799e1b3e0 Vladimir Oltean 2020-09-18  368  				     sizeof(struct ocelot_port *), GFP_KERNEL);
7c411799e1b3e0 Vladimir Oltean 2020-09-18  369  	if (!ocelot->ports)
7c411799e1b3e0 Vladimir Oltean 2020-09-18  370  		return -ENOMEM;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  371  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  372  	ocelot->devlink_ports = devm_kcalloc(ocelot->dev,
6c30384eb1dec9 Vladimir Oltean 2021-01-15  373  					     ocelot->num_phys_ports,
6c30384eb1dec9 Vladimir Oltean 2021-01-15  374  					     sizeof(*ocelot->devlink_ports),
6c30384eb1dec9 Vladimir Oltean 2021-01-15  375  					     GFP_KERNEL);
6c30384eb1dec9 Vladimir Oltean 2021-01-15  376  	if (!ocelot->devlink_ports)
6c30384eb1dec9 Vladimir Oltean 2021-01-15  377  		return -ENOMEM;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  378  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  379  	for_each_available_child_of_node(ports, portnp) {
7c411799e1b3e0 Vladimir Oltean 2020-09-18 @380  		struct ocelot_port *ocelot_port;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  381  		struct regmap *target;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  382  		struct resource *res;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  383  		char res_name[8];
7c411799e1b3e0 Vladimir Oltean 2020-09-18  384  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  385  		if (of_property_read_u32(portnp, "reg", &reg))
7c411799e1b3e0 Vladimir Oltean 2020-09-18  386  			continue;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  387  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  388  		port = reg;
e0c16233577fb8 Dan Carpenter   2021-02-02  389  		if (port < 0 || port >= ocelot->num_phys_ports) {
e0c16233577fb8 Dan Carpenter   2021-02-02  390  			dev_err(ocelot->dev,
e0c16233577fb8 Dan Carpenter   2021-02-02  391  				"invalid port number: %d >= %d\n", port,
e0c16233577fb8 Dan Carpenter   2021-02-02  392  				ocelot->num_phys_ports);
e0c16233577fb8 Dan Carpenter   2021-02-02  393  			continue;
e0c16233577fb8 Dan Carpenter   2021-02-02  394  		}
6c30384eb1dec9 Vladimir Oltean 2021-01-15  395  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  396  		snprintf(res_name, sizeof(res_name), "port%d", port);
7c411799e1b3e0 Vladimir Oltean 2020-09-18  397  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  398  		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
7c411799e1b3e0 Vladimir Oltean 2020-09-18  399  						   res_name);
7c411799e1b3e0 Vladimir Oltean 2020-09-18  400  		target = ocelot_regmap_init(ocelot, res);
e0c16233577fb8 Dan Carpenter   2021-02-02  401  		if (IS_ERR(target)) {
e0c16233577fb8 Dan Carpenter   2021-02-02  402  			err = PTR_ERR(target);
d1a7b9e4696584 Wan Jiabing     2021-10-17  403  			of_node_put(portnp);
e0c16233577fb8 Dan Carpenter   2021-02-02  404  			goto out_teardown;
e0c16233577fb8 Dan Carpenter   2021-02-02  405  		}
7c411799e1b3e0 Vladimir Oltean 2020-09-18  406  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  407  		err = ocelot_port_devlink_init(ocelot, port,
6c30384eb1dec9 Vladimir Oltean 2021-01-15  408  					       DEVLINK_PORT_FLAVOUR_PHYSICAL);
6c30384eb1dec9 Vladimir Oltean 2021-01-15  409  		if (err) {
6c30384eb1dec9 Vladimir Oltean 2021-01-15  410  			of_node_put(portnp);
6c30384eb1dec9 Vladimir Oltean 2021-01-15  411  			goto out_teardown;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  412  		}
6c30384eb1dec9 Vladimir Oltean 2021-01-15  413  
e6e12df625f23e Vladimir Oltean 2021-08-15  414  		err = ocelot_probe_port(ocelot, port, target, portnp);
7c411799e1b3e0 Vladimir Oltean 2020-09-18  415  		if (err) {
5c8bb71dbdf816 Vladimir Oltean 2021-08-19  416  			ocelot_port_devlink_teardown(ocelot, port);
5c8bb71dbdf816 Vladimir Oltean 2021-08-19  417  			continue;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  418  		}
7c411799e1b3e0 Vladimir Oltean 2020-09-18  419  
5c8bb71dbdf816 Vladimir Oltean 2021-08-19  420  		devlink_ports_registered |= BIT(port);
5c8bb71dbdf816 Vladimir Oltean 2021-08-19  421  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  422  		ocelot_port = ocelot->ports[port];
7c411799e1b3e0 Vladimir Oltean 2020-09-18  423  	}
7c411799e1b3e0 Vladimir Oltean 2020-09-18  424  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  425  	/* Initialize unused devlink ports at the end */
6c30384eb1dec9 Vladimir Oltean 2021-01-15  426  	for (port = 0; port < ocelot->num_phys_ports; port++) {
e0c16233577fb8 Dan Carpenter   2021-02-02  427  		if (devlink_ports_registered & BIT(port))
6c30384eb1dec9 Vladimir Oltean 2021-01-15  428  			continue;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  429  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  430  		err = ocelot_port_devlink_init(ocelot, port,
6c30384eb1dec9 Vladimir Oltean 2021-01-15  431  					       DEVLINK_PORT_FLAVOUR_UNUSED);
e0c16233577fb8 Dan Carpenter   2021-02-02  432  		if (err)
6c30384eb1dec9 Vladimir Oltean 2021-01-15  433  			goto out_teardown;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  434  
e0c16233577fb8 Dan Carpenter   2021-02-02  435  		devlink_ports_registered |= BIT(port);
e0c16233577fb8 Dan Carpenter   2021-02-02  436  	}
6c30384eb1dec9 Vladimir Oltean 2021-01-15  437  
7c411799e1b3e0 Vladimir Oltean 2020-09-18  438  	return 0;
6c30384eb1dec9 Vladimir Oltean 2021-01-15  439  
6c30384eb1dec9 Vladimir Oltean 2021-01-15  440  out_teardown:
6c30384eb1dec9 Vladimir Oltean 2021-01-15  441  	/* Unregister the network interfaces */
6c30384eb1dec9 Vladimir Oltean 2021-01-15  442  	mscc_ocelot_release_ports(ocelot);
6c30384eb1dec9 Vladimir Oltean 2021-01-15  443  	/* Tear down devlink ports for the registered network interfaces */
6c30384eb1dec9 Vladimir Oltean 2021-01-15  444  	for (port = 0; port < ocelot->num_phys_ports; port++) {
e0c16233577fb8 Dan Carpenter   2021-02-02  445  		if (devlink_ports_registered & BIT(port))
6c30384eb1dec9 Vladimir Oltean 2021-01-15  446  			ocelot_port_devlink_teardown(ocelot, port);
6c30384eb1dec9 Vladimir Oltean 2021-01-15  447  	}
6c30384eb1dec9 Vladimir Oltean 2021-01-15  448  	return err;
7c411799e1b3e0 Vladimir Oltean 2020-09-18  449  }
7c411799e1b3e0 Vladimir Oltean 2020-09-18  450  

:::::: The code at line 380 was first introduced by commit
:::::: 7c411799e1b3e0efa3a50e44e98cce6a771441c6 net: mscc: ocelot: refactor ports parsing code into a dedicated function

:::::: TO: Vladimir Oltean <vladimir.oltean@....com>
:::::: CC: David S. Miller <davem@...emloft.net>

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

View attachment "config" of type "text/plain" (318604 bytes)

Powered by blists - more mailing lists