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: <201709070338.EVYgbSOf%fengguang.wu@intel.com>
Date:   Thu, 7 Sep 2017 03:30:41 +0800
From:   kbuild test robot <fengguang.wu@...el.com>
To:     "David S. Miller" <davem@...emloft.net>
Cc:     kbuild-all@...org, netdev@...r.kernel.org,
        Bob Copeland <me@...copeland.com>
Subject: [wireless-testsing2:master 4/5]
 drivers/net//ethernet/marvell/mvpp2.c:7618:2: warning: passing argument 4 of
 'mvpp2_port_copy_mac_addr' from incompatible pointer type

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-testing.git master
head:   d17be7f7503bf9492198a242779a68af93fd92de
commit: 96c03618031bae5e9068b16f9e437b79f98f6482 [4/5] Merge remote-tracking branch 'mac80211-next/master'
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 96c03618031bae5e9068b16f9e437b79f98f6482
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   drivers/net//ethernet/marvell/mvpp2.c: In function 'mvpp2_port_probe':
>> drivers/net//ethernet/marvell/mvpp2.c:7618:2: warning: passing argument 4 of 'mvpp2_port_copy_mac_addr' from incompatible pointer type
     mvpp2_port_copy_mac_addr(dev, priv, port_node, &mac_from);
     ^
   drivers/net//ethernet/marvell/mvpp2.c:7468:13: note: expected 'char **' but argument is of type 'const char **'
    static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv,
                ^
   drivers/net//ethernet/marvell/mvpp2.c:7509:7: warning: unused variable 'hw_mac_addr' [-Wunused-variable]
     char hw_mac_addr[ETH_ALEN] = {0};
          ^
   drivers/net//ethernet/marvell/mvpp2.c:7507:14: warning: unused variable 'dt_mac_addr' [-Wunused-variable]
     const char *dt_mac_addr;
                 ^

vim +/mvpp2_port_copy_mac_addr +7618 drivers/net//ethernet/marvell/mvpp2.c

3ba8c81e1 Antoine Tenart   2017-09-02  7495  
3f518509d Marcin Wojtas    2014-07-10  7496  /* Ports initialization */
3f518509d Marcin Wojtas    2014-07-10  7497  static int mvpp2_port_probe(struct platform_device *pdev,
3f518509d Marcin Wojtas    2014-07-10  7498  			    struct device_node *port_node,
59b9a31ed Thomas Petazzoni 2017-03-07  7499  			    struct mvpp2 *priv)
3f518509d Marcin Wojtas    2014-07-10  7500  {
3f518509d Marcin Wojtas    2014-07-10  7501  	struct device_node *phy_node;
542897d98 Antoine Tenart   2017-08-30  7502  	struct phy *comphy;
3f518509d Marcin Wojtas    2014-07-10  7503  	struct mvpp2_port *port;
edc660fa0 Marcin Wojtas    2015-08-06  7504  	struct mvpp2_port_pcpu *port_pcpu;
3f518509d Marcin Wojtas    2014-07-10  7505  	struct net_device *dev;
3f518509d Marcin Wojtas    2014-07-10  7506  	struct resource *res;
3f518509d Marcin Wojtas    2014-07-10  7507  	const char *dt_mac_addr;
96c036180 Bob Copeland     2017-09-04  7508  	const char *mac_from = "";
4c2286826 Antoine Tenart   2017-08-25  7509  	char hw_mac_addr[ETH_ALEN] = {0};
09f839755 Thomas Petazzoni 2017-08-03  7510  	unsigned int ntxqs, nrxqs;
213f428f5 Thomas Petazzoni 2017-08-03  7511  	bool has_tx_irqs;
3f518509d Marcin Wojtas    2014-07-10  7512  	u32 id;
3f518509d Marcin Wojtas    2014-07-10  7513  	int features;
3f518509d Marcin Wojtas    2014-07-10  7514  	int phy_mode;
edc660fa0 Marcin Wojtas    2015-08-06  7515  	int err, i, cpu;
3f518509d Marcin Wojtas    2014-07-10  7516  
213f428f5 Thomas Petazzoni 2017-08-03  7517  	has_tx_irqs = mvpp2_port_has_tx_irqs(priv, port_node);
213f428f5 Thomas Petazzoni 2017-08-03  7518  
213f428f5 Thomas Petazzoni 2017-08-03  7519  	if (!has_tx_irqs)
213f428f5 Thomas Petazzoni 2017-08-03  7520  		queue_mode = MVPP2_QDIST_SINGLE_MODE;
213f428f5 Thomas Petazzoni 2017-08-03  7521  
09f839755 Thomas Petazzoni 2017-08-03  7522  	ntxqs = MVPP2_MAX_TXQ;
213f428f5 Thomas Petazzoni 2017-08-03  7523  	if (priv->hw_version == MVPP22 && queue_mode == MVPP2_QDIST_MULTI_MODE)
213f428f5 Thomas Petazzoni 2017-08-03  7524  		nrxqs = MVPP2_DEFAULT_RXQ * num_possible_cpus();
213f428f5 Thomas Petazzoni 2017-08-03  7525  	else
09f839755 Thomas Petazzoni 2017-08-03  7526  		nrxqs = MVPP2_DEFAULT_RXQ;
09f839755 Thomas Petazzoni 2017-08-03  7527  
09f839755 Thomas Petazzoni 2017-08-03  7528  	dev = alloc_etherdev_mqs(sizeof(*port), ntxqs, nrxqs);
3f518509d Marcin Wojtas    2014-07-10  7529  	if (!dev)
3f518509d Marcin Wojtas    2014-07-10  7530  		return -ENOMEM;
3f518509d Marcin Wojtas    2014-07-10  7531  
3f518509d Marcin Wojtas    2014-07-10  7532  	phy_node = of_parse_phandle(port_node, "phy", 0);
3f518509d Marcin Wojtas    2014-07-10  7533  	phy_mode = of_get_phy_mode(port_node);
3f518509d Marcin Wojtas    2014-07-10  7534  	if (phy_mode < 0) {
3f518509d Marcin Wojtas    2014-07-10  7535  		dev_err(&pdev->dev, "incorrect phy mode\n");
3f518509d Marcin Wojtas    2014-07-10  7536  		err = phy_mode;
3f518509d Marcin Wojtas    2014-07-10  7537  		goto err_free_netdev;
3f518509d Marcin Wojtas    2014-07-10  7538  	}
3f518509d Marcin Wojtas    2014-07-10  7539  
542897d98 Antoine Tenart   2017-08-30  7540  	comphy = devm_of_phy_get(&pdev->dev, port_node, NULL);
542897d98 Antoine Tenart   2017-08-30  7541  	if (IS_ERR(comphy)) {
542897d98 Antoine Tenart   2017-08-30  7542  		if (PTR_ERR(comphy) == -EPROBE_DEFER) {
542897d98 Antoine Tenart   2017-08-30  7543  			err = -EPROBE_DEFER;
542897d98 Antoine Tenart   2017-08-30  7544  			goto err_free_netdev;
542897d98 Antoine Tenart   2017-08-30  7545  		}
542897d98 Antoine Tenart   2017-08-30  7546  		comphy = NULL;
542897d98 Antoine Tenart   2017-08-30  7547  	}
542897d98 Antoine Tenart   2017-08-30  7548  
3f518509d Marcin Wojtas    2014-07-10  7549  	if (of_property_read_u32(port_node, "port-id", &id)) {
3f518509d Marcin Wojtas    2014-07-10  7550  		err = -EINVAL;
3f518509d Marcin Wojtas    2014-07-10  7551  		dev_err(&pdev->dev, "missing port-id value\n");
3f518509d Marcin Wojtas    2014-07-10  7552  		goto err_free_netdev;
3f518509d Marcin Wojtas    2014-07-10  7553  	}
3f518509d Marcin Wojtas    2014-07-10  7554  
3f518509d Marcin Wojtas    2014-07-10  7555  	dev->tx_queue_len = MVPP2_MAX_TXD;
3f518509d Marcin Wojtas    2014-07-10  7556  	dev->watchdog_timeo = 5 * HZ;
3f518509d Marcin Wojtas    2014-07-10  7557  	dev->netdev_ops = &mvpp2_netdev_ops;
3f518509d Marcin Wojtas    2014-07-10  7558  	dev->ethtool_ops = &mvpp2_eth_tool_ops;
3f518509d Marcin Wojtas    2014-07-10  7559  
3f518509d Marcin Wojtas    2014-07-10  7560  	port = netdev_priv(dev);
591f4cfab Thomas Petazzoni 2017-08-03  7561  	port->dev = dev;
09f839755 Thomas Petazzoni 2017-08-03  7562  	port->ntxqs = ntxqs;
09f839755 Thomas Petazzoni 2017-08-03  7563  	port->nrxqs = nrxqs;
213f428f5 Thomas Petazzoni 2017-08-03  7564  	port->priv = priv;
213f428f5 Thomas Petazzoni 2017-08-03  7565  	port->has_tx_irqs = has_tx_irqs;
3f518509d Marcin Wojtas    2014-07-10  7566  
591f4cfab Thomas Petazzoni 2017-08-03  7567  	err = mvpp2_queue_vectors_init(port, port_node);
591f4cfab Thomas Petazzoni 2017-08-03  7568  	if (err)
3f518509d Marcin Wojtas    2014-07-10  7569  		goto err_free_netdev;
3f518509d Marcin Wojtas    2014-07-10  7570  
fd3651b2a Antoine Tenart   2017-09-01  7571  	port->link_irq = of_irq_get_byname(port_node, "link");
fd3651b2a Antoine Tenart   2017-09-01  7572  	if (port->link_irq == -EPROBE_DEFER) {
fd3651b2a Antoine Tenart   2017-09-01  7573  		err = -EPROBE_DEFER;
fd3651b2a Antoine Tenart   2017-09-01  7574  		goto err_deinit_qvecs;
fd3651b2a Antoine Tenart   2017-09-01  7575  	}
fd3651b2a Antoine Tenart   2017-09-01  7576  	if (port->link_irq <= 0)
fd3651b2a Antoine Tenart   2017-09-01  7577  		/* the link irq is optional */
fd3651b2a Antoine Tenart   2017-09-01  7578  		port->link_irq = 0;
fd3651b2a Antoine Tenart   2017-09-01  7579  
3f518509d Marcin Wojtas    2014-07-10  7580  	if (of_property_read_bool(port_node, "marvell,loopback"))
3f518509d Marcin Wojtas    2014-07-10  7581  		port->flags |= MVPP2_F_LOOPBACK;
3f518509d Marcin Wojtas    2014-07-10  7582  
3f518509d Marcin Wojtas    2014-07-10  7583  	port->id = id;
59b9a31ed Thomas Petazzoni 2017-03-07  7584  	if (priv->hw_version == MVPP21)
09f839755 Thomas Petazzoni 2017-08-03  7585  		port->first_rxq = port->id * port->nrxqs;
59b9a31ed Thomas Petazzoni 2017-03-07  7586  	else
59b9a31ed Thomas Petazzoni 2017-03-07  7587  		port->first_rxq = port->id * priv->max_port_rxqs;
59b9a31ed Thomas Petazzoni 2017-03-07  7588  
3f518509d Marcin Wojtas    2014-07-10  7589  	port->phy_node = phy_node;
3f518509d Marcin Wojtas    2014-07-10  7590  	port->phy_interface = phy_mode;
542897d98 Antoine Tenart   2017-08-30  7591  	port->comphy = comphy;
3f518509d Marcin Wojtas    2014-07-10  7592  
a786841df Thomas Petazzoni 2017-03-07  7593  	if (priv->hw_version == MVPP21) {
a786841df Thomas Petazzoni 2017-03-07  7594  		res = platform_get_resource(pdev, IORESOURCE_MEM, 2 + id);
3f518509d Marcin Wojtas    2014-07-10  7595  		port->base = devm_ioremap_resource(&pdev->dev, res);
3f518509d Marcin Wojtas    2014-07-10  7596  		if (IS_ERR(port->base)) {
3f518509d Marcin Wojtas    2014-07-10  7597  			err = PTR_ERR(port->base);
fd3651b2a Antoine Tenart   2017-09-01  7598  			goto err_free_irq;
3f518509d Marcin Wojtas    2014-07-10  7599  		}
a786841df Thomas Petazzoni 2017-03-07  7600  	} else {
a786841df Thomas Petazzoni 2017-03-07  7601  		if (of_property_read_u32(port_node, "gop-port-id",
a786841df Thomas Petazzoni 2017-03-07  7602  					 &port->gop_id)) {
a786841df Thomas Petazzoni 2017-03-07  7603  			err = -EINVAL;
a786841df Thomas Petazzoni 2017-03-07  7604  			dev_err(&pdev->dev, "missing gop-port-id value\n");
591f4cfab Thomas Petazzoni 2017-08-03  7605  			goto err_deinit_qvecs;
a786841df Thomas Petazzoni 2017-03-07  7606  		}
a786841df Thomas Petazzoni 2017-03-07  7607  
a786841df Thomas Petazzoni 2017-03-07  7608  		port->base = priv->iface_base + MVPP22_GMAC_BASE(port->gop_id);
a786841df Thomas Petazzoni 2017-03-07  7609  	}
3f518509d Marcin Wojtas    2014-07-10  7610  
3f518509d Marcin Wojtas    2014-07-10  7611  	/* Alloc per-cpu stats */
3f518509d Marcin Wojtas    2014-07-10  7612  	port->stats = netdev_alloc_pcpu_stats(struct mvpp2_pcpu_stats);
3f518509d Marcin Wojtas    2014-07-10  7613  	if (!port->stats) {
3f518509d Marcin Wojtas    2014-07-10  7614  		err = -ENOMEM;
fd3651b2a Antoine Tenart   2017-09-01  7615  		goto err_free_irq;
3f518509d Marcin Wojtas    2014-07-10  7616  	}
3f518509d Marcin Wojtas    2014-07-10  7617  
3ba8c81e1 Antoine Tenart   2017-09-02 @7618  	mvpp2_port_copy_mac_addr(dev, priv, port_node, &mac_from);
3f518509d Marcin Wojtas    2014-07-10  7619  
3f518509d Marcin Wojtas    2014-07-10  7620  	port->tx_ring_size = MVPP2_MAX_TXD;
3f518509d Marcin Wojtas    2014-07-10  7621  	port->rx_ring_size = MVPP2_MAX_RXD;
3f518509d Marcin Wojtas    2014-07-10  7622  	SET_NETDEV_DEV(dev, &pdev->dev);
3f518509d Marcin Wojtas    2014-07-10  7623  
3f518509d Marcin Wojtas    2014-07-10  7624  	err = mvpp2_port_init(port);
3f518509d Marcin Wojtas    2014-07-10  7625  	if (err < 0) {
3f518509d Marcin Wojtas    2014-07-10  7626  		dev_err(&pdev->dev, "failed to init port %d\n", id);
3f518509d Marcin Wojtas    2014-07-10  7627  		goto err_free_stats;
3f518509d Marcin Wojtas    2014-07-10  7628  	}
269758214 Thomas Petazzoni 2017-03-07  7629  
269758214 Thomas Petazzoni 2017-03-07  7630  	mvpp2_port_periodic_xon_disable(port);
269758214 Thomas Petazzoni 2017-03-07  7631  
269758214 Thomas Petazzoni 2017-03-07  7632  	if (priv->hw_version == MVPP21)
269758214 Thomas Petazzoni 2017-03-07  7633  		mvpp2_port_fc_adv_enable(port);
269758214 Thomas Petazzoni 2017-03-07  7634  
269758214 Thomas Petazzoni 2017-03-07  7635  	mvpp2_port_reset(port);
3f518509d Marcin Wojtas    2014-07-10  7636  
edc660fa0 Marcin Wojtas    2015-08-06  7637  	port->pcpu = alloc_percpu(struct mvpp2_port_pcpu);
edc660fa0 Marcin Wojtas    2015-08-06  7638  	if (!port->pcpu) {
edc660fa0 Marcin Wojtas    2015-08-06  7639  		err = -ENOMEM;
edc660fa0 Marcin Wojtas    2015-08-06  7640  		goto err_free_txq_pcpu;
edc660fa0 Marcin Wojtas    2015-08-06  7641  	}
edc660fa0 Marcin Wojtas    2015-08-06  7642  
213f428f5 Thomas Petazzoni 2017-08-03  7643  	if (!port->has_tx_irqs) {
edc660fa0 Marcin Wojtas    2015-08-06  7644  		for_each_present_cpu(cpu) {
edc660fa0 Marcin Wojtas    2015-08-06  7645  			port_pcpu = per_cpu_ptr(port->pcpu, cpu);
edc660fa0 Marcin Wojtas    2015-08-06  7646  
edc660fa0 Marcin Wojtas    2015-08-06  7647  			hrtimer_init(&port_pcpu->tx_done_timer, CLOCK_MONOTONIC,
edc660fa0 Marcin Wojtas    2015-08-06  7648  				     HRTIMER_MODE_REL_PINNED);
edc660fa0 Marcin Wojtas    2015-08-06  7649  			port_pcpu->tx_done_timer.function = mvpp2_hr_timer_cb;
edc660fa0 Marcin Wojtas    2015-08-06  7650  			port_pcpu->timer_scheduled = false;
edc660fa0 Marcin Wojtas    2015-08-06  7651  
213f428f5 Thomas Petazzoni 2017-08-03  7652  			tasklet_init(&port_pcpu->tx_done_tasklet,
213f428f5 Thomas Petazzoni 2017-08-03  7653  				     mvpp2_tx_proc_cb,
edc660fa0 Marcin Wojtas    2015-08-06  7654  				     (unsigned long)dev);
edc660fa0 Marcin Wojtas    2015-08-06  7655  		}
213f428f5 Thomas Petazzoni 2017-08-03  7656  	}
edc660fa0 Marcin Wojtas    2015-08-06  7657  
186cd4d4e Antoine Tenart   2017-08-23  7658  	features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
3f518509d Marcin Wojtas    2014-07-10  7659  	dev->features = features | NETIF_F_RXCSUM;
3f518509d Marcin Wojtas    2014-07-10  7660  	dev->hw_features |= features | NETIF_F_RXCSUM | NETIF_F_GRO;
3f518509d Marcin Wojtas    2014-07-10  7661  	dev->vlan_features |= features;
3f518509d Marcin Wojtas    2014-07-10  7662  
5777987e0 Jarod Wilson     2016-10-17  7663  	/* MTU range: 68 - 9676 */
5777987e0 Jarod Wilson     2016-10-17  7664  	dev->min_mtu = ETH_MIN_MTU;
5777987e0 Jarod Wilson     2016-10-17  7665  	/* 9676 == 9700 - 20 and rounding to 8 */
5777987e0 Jarod Wilson     2016-10-17  7666  	dev->max_mtu = 9676;
5777987e0 Jarod Wilson     2016-10-17  7667  
3f518509d Marcin Wojtas    2014-07-10  7668  	err = register_netdev(dev);
3f518509d Marcin Wojtas    2014-07-10  7669  	if (err < 0) {
3f518509d Marcin Wojtas    2014-07-10  7670  		dev_err(&pdev->dev, "failed to register netdev\n");
edc660fa0 Marcin Wojtas    2015-08-06  7671  		goto err_free_port_pcpu;
3f518509d Marcin Wojtas    2014-07-10  7672  	}
3f518509d Marcin Wojtas    2014-07-10  7673  	netdev_info(dev, "Using %s mac address %pM\n", mac_from, dev->dev_addr);
3f518509d Marcin Wojtas    2014-07-10  7674  
3f518509d Marcin Wojtas    2014-07-10  7675  	priv->port_list[id] = port;
3f518509d Marcin Wojtas    2014-07-10  7676  	return 0;
3f518509d Marcin Wojtas    2014-07-10  7677  
edc660fa0 Marcin Wojtas    2015-08-06  7678  err_free_port_pcpu:
edc660fa0 Marcin Wojtas    2015-08-06  7679  	free_percpu(port->pcpu);
3f518509d Marcin Wojtas    2014-07-10  7680  err_free_txq_pcpu:
09f839755 Thomas Petazzoni 2017-08-03  7681  	for (i = 0; i < port->ntxqs; i++)
3f518509d Marcin Wojtas    2014-07-10  7682  		free_percpu(port->txqs[i]->pcpu);
3f518509d Marcin Wojtas    2014-07-10  7683  err_free_stats:
3f518509d Marcin Wojtas    2014-07-10  7684  	free_percpu(port->stats);
fd3651b2a Antoine Tenart   2017-09-01  7685  err_free_irq:
fd3651b2a Antoine Tenart   2017-09-01  7686  	if (port->link_irq)
fd3651b2a Antoine Tenart   2017-09-01  7687  		irq_dispose_mapping(port->link_irq);
591f4cfab Thomas Petazzoni 2017-08-03  7688  err_deinit_qvecs:
591f4cfab Thomas Petazzoni 2017-08-03  7689  	mvpp2_queue_vectors_deinit(port);
3f518509d Marcin Wojtas    2014-07-10  7690  err_free_netdev:
ccb80393c Peter Chen       2016-08-01  7691  	of_node_put(phy_node);
3f518509d Marcin Wojtas    2014-07-10  7692  	free_netdev(dev);
3f518509d Marcin Wojtas    2014-07-10  7693  	return err;
3f518509d Marcin Wojtas    2014-07-10  7694  }
3f518509d Marcin Wojtas    2014-07-10  7695  

:::::: The code at line 7618 was first introduced by commit
:::::: 3ba8c81e15c11fc396d0b5d11adaf9db6ed39533 net: mvpp2: move the mac retrieval/copy logic into its own function

:::::: TO: Antoine Tenart <antoine.tenart@...e-electrons.com>
:::::: CC: David S. Miller <davem@...emloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (51119 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ