[renesas-drivers:master 35/44] drivers/net/ethernet/marvell/sky2.c:4808:3: note: in expansion of macro 'memcpy'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git master
head:   24dbd4dc75ef5687470d7a6beb9c7bdf65872965
commit: da44e425891659de2ecef656ffec3c474467b162 [35/44] net: ethernet: support of_get_mac_address new ERR_PTR error
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout da44e425891659de2ecef656ffec3c474467b162
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/string.h:3:0,
                    from include/linux/string.h:20,
                    from arch/x86/include/asm/page_32.h:35,
                    from arch/x86/include/asm/page.h:14,
                    from arch/x86/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:38,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:10,
                    from drivers/net/ethernet/marvell/sky2.c:29:
   drivers/net/ethernet/marvell/sky2.c: In function 'sky2_init_netdev.constprop':
   arch/x86/include/asm/string_32.h:182:25: warning: argument 2 null where non-null expected [-Wnonnull]
    #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/marvell/sky2.c:4808:3: note: in expansion of macro 'memcpy'
      memcpy(dev->dev_addr, iap, ETH_ALEN);
      ^~~~~~
   arch/x86/include/asm/string_32.h:182:25: note: in a call to built-in function '__builtin_memcpy'
    #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/marvell/sky2.c:4808:3: note: in expansion of macro 'memcpy'
      memcpy(dev->dev_addr, iap, ETH_ALEN);
      ^~~~~~

vim +/memcpy +4808 drivers/net/ethernet/marvell/sky2.c

3cf267539 drivers/net/sky2.c                  Stephen Hemminger  2007-07-09  4729  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4730  /* Initialize network device */
1dd06ae8d drivers/net/ethernet/marvell/sky2.c Greg Kroah-Hartman 2012-12-06  4731  static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,
be63a21c9 drivers/net/sky2.c                  Stephen Hemminger  2008-01-15  4732  					   int highmem, int wol)
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4733  {
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4734  	struct sky2_port *sky2;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4735  	struct net_device *dev = alloc_etherdev(sizeof(*sky2));
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4736  	const void *iap;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4737  
41de8d4cf drivers/net/ethernet/marvell/sky2.c Joe Perches        2012-01-29  4738  	if (!dev)
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4739  		return NULL;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4740  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4741  	SET_NETDEV_DEV(dev, &hw->pdev->dev);
ef743d335 drivers/net/sky2.c                  Stephen Hemminger  2005-11-30  4742  	dev->irq = hw->pdev->irq;
7ad24ea4b drivers/net/ethernet/marvell/sky2.c Wilfried Klaebe    2014-05-11  4743  	dev->ethtool_ops = &sky2_ethtool_ops;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4744  	dev->watchdog_timeo = TX_WATCHDOG;
1436b301e drivers/net/sky2.c                  Stephen Hemminger  2008-11-19  4745  	dev->netdev_ops = &sky2_netdev_ops[port];
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4746  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4747  	sky2 = netdev_priv(dev);
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4748  	sky2->netdev = dev;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4749  	sky2->hw = hw;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4750  	sky2->msg_enable = netif_msg_init(debug, default_msg);
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4751  
827da44c6 drivers/net/ethernet/marvell/sky2.c John Stultz        2013-10-07  4752  	u64_stats_init(&sky2->tx_stats.syncp);
827da44c6 drivers/net/ethernet/marvell/sky2.c John Stultz        2013-10-07  4753  	u64_stats_init(&sky2->rx_stats.syncp);
827da44c6 drivers/net/ethernet/marvell/sky2.c John Stultz        2013-10-07  4754  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4755  	/* Auto speed and flow control */
0ea065e52 drivers/net/sky2.c                  Stephen Hemminger  2009-08-14  4756  	sky2->flags = SKY2_FLAG_AUTO_SPEED | SKY2_FLAG_AUTO_PAUSE;
0ea065e52 drivers/net/sky2.c                  Stephen Hemminger  2009-08-14  4757  	if (hw->chip_id != CHIP_ID_YUKON_XL)
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4758  		dev->hw_features |= NETIF_F_RXCSUM;
0ea065e52 drivers/net/sky2.c                  Stephen Hemminger  2009-08-14  4759  
16ad91e1c drivers/net/sky2.c                  Stephen Hemminger  2006-10-17  4760  	sky2->flow_mode = FC_BOTH;
16ad91e1c drivers/net/sky2.c                  Stephen Hemminger  2006-10-17  4761  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4762  	sky2->duplex = -1;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4763  	sky2->speed = -1;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4764  	sky2->advertising = sky2_supported_modes(hw);
be63a21c9 drivers/net/sky2.c                  Stephen Hemminger  2008-01-15  4765  	sky2->wol = wol;
75d070c56 drivers/net/sky2.c                  Stephen Hemminger  2005-12-09  4766  
e07b1aa8b drivers/net/sky2.c                  Stephen Hemminger  2006-03-20  4767  	spin_lock_init(&sky2->phy_lock);
ee5f68fea drivers/net/sky2.c                  Stephen Hemminger  2009-08-18  4768  
793b883ed drivers/net/sky2.c                  Stephen Hemminger  2005-09-14  4769  	sky2->tx_pending = TX_DEF_PENDING;
738a849c8 drivers/net/ethernet/marvell/sky2.c stephen hemminger  2011-11-17  4770  	sky2->tx_ring_size = roundup_ring_size(TX_DEF_PENDING);
290d4de5b drivers/net/sky2.c                  Stephen Hemminger  2006-03-20  4771  	sky2->rx_pending = RX_DEF_PENDING;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4772  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4773  	hw->dev[port] = dev;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4774  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4775  	sky2->port = port;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4776  
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4777  	dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO;
86aa77854 drivers/net/sky2.c                  Stephen Hemminger  2011-01-09  4778  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4779  	if (highmem)
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4780  		dev->features |= NETIF_F_HIGHDMA;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4781  
bf73130d7 drivers/net/sky2.c                  Stephen Hemminger  2010-04-24  4782  	/* Enable receive hashing unless hardware is known broken */
bf73130d7 drivers/net/sky2.c                  Stephen Hemminger  2010-04-24  4783  	if (!(hw->flags & SKY2_HW_RSS_BROKEN))
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4784  		dev->hw_features |= NETIF_F_RXHASH;
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4785  
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4786  	if (!(hw->flags & SKY2_HW_VLAN_BROKEN)) {
f646968f8 drivers/net/ethernet/marvell/sky2.c Patrick McHardy    2013-04-19  4787  		dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX |
f646968f8 drivers/net/ethernet/marvell/sky2.c Patrick McHardy    2013-04-19  4788  				    NETIF_F_HW_VLAN_CTAG_RX;
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4789  		dev->vlan_features |= SKY2_VLAN_OFFLOADS;
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4790  	}
bf73130d7 drivers/net/sky2.c                  Stephen Hemminger  2010-04-24  4791  
f5d640371 drivers/net/sky2.c                  Michał Mirosław    2011-04-10  4792  	dev->features |= dev->hw_features;
d1f137086 drivers/net/sky2.c                  Stephen Hemminger  2005-09-27  4793  
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4794  	/* MTU range: 60 - 1500 or 9000 */
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4795  	dev->min_mtu = ETH_ZLEN;
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4796  	if (hw->chip_id == CHIP_ID_YUKON_FE ||
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4797  	    hw->chip_id == CHIP_ID_YUKON_FE_P)
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4798  		dev->max_mtu = ETH_DATA_LEN;
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4799  	else
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4800  		dev->max_mtu = ETH_JUMBO_MTU;
5777987e0 drivers/net/ethernet/marvell/sky2.c Jarod Wilson       2016-10-17  4801  
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4802  	/* try to get mac address in the following order:
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4803  	 * 1) from device tree data
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4804  	 * 2) from internal registers set by bootloader
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4805  	 */
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4806  	iap = of_get_mac_address(hw->pdev->dev.of_node);
da44e4258 drivers/net/ethernet/marvell/sky2.c Petr Štetiar       2019-05-06  4807  	if (!IS_ERR(iap))
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07 @4808  		memcpy(dev->dev_addr, iap, ETH_ALEN);
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4809  	else
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4810  		memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8,
3ee2f8ce1 drivers/net/ethernet/marvell/sky2.c Tim Harvey         2014-03-07  4811  			      ETH_ALEN);
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4812  
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4813  	/* if the address is invalid, use a random value */
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4814  	if (!is_valid_ether_addr(dev->dev_addr)) {
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4815  		struct sockaddr sa = { AF_UNSPEC };
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4816  
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4817  		netdev_warn(dev,
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4818  			    "Invalid MAC address, defaulting to random\n");
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4819  		eth_hw_addr_random(dev);
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4820  		memcpy(sa.sa_data, dev->dev_addr, ETH_ALEN);
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4821  		if (sky2_set_mac_address(dev, &sa))
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4822  			netdev_warn(dev, "Failed to set MAC address.\n");
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4823  	}
0f50c10d2 drivers/net/ethernet/marvell/sky2.c Liviu Dudau        2015-09-28  4824  
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4825  	return dev;
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4826  }
cd28ab6a4 drivers/net/sky2.c                  Stephen Hemminger  2005-08-16  4827  

:::::: The code at line 4808 was first introduced by commit
:::::: 3ee2f8ce1ab8f235bda164295fa0cf39ec1c2400 sky2: allow mac to come from dt

:::::: TO: Tim Harvey <tharvey@xxxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux