[efi:next 13/15] drivers/net/ethernet/apm/xgene/xgene_enet_main.c:2071:42: warning: shift count >= width of type

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   172a289d21a309d2d56b44d4a07a129cb1173b92
commit: b640807322bb7dd7bd2a5462e5cb142bc0bb2c06 [13/15] efi: ia64: disable the capsule loader
config: x86_64-randconfig-a003-20201214 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project d38205144febf4dc42c9270c6aa3d978f1ef65e1)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=b640807322bb7dd7bd2a5462e5cb142bc0bb2c06
        git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
        git fetch --no-tags efi next
        git checkout b640807322bb7dd7bd2a5462e5cb142bc0bb2c06
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/apm/xgene/xgene_enet_main.c:11:
   In file included from drivers/net/ethernet/apm/xgene/xgene_enet_main.h:15:
   include/linux/efi.h:1050:20: error: redefinition of 'efi_capsule_pending'
   static inline bool efi_capsule_pending(int *reset_type) { return false; }
                      ^
   include/linux/efi.h:821:1: note: previous definition is here
   efi_capsule_pending(int *reset_type)
   ^
   drivers/net/ethernet/apm/xgene/xgene_enet_main.c:2042:20: warning: cast to smaller integer type 'enum xgene_enet_id' from 'const void *' [-Wvoid-pointer-to-enum-cast]
                   pdata->enet_id = (enum xgene_enet_id)of_id->data;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/apm/xgene/xgene_enet_main.c:2071:42: warning: shift count >= width of type [-Wshift-count-overflow]
           ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
                                                   ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   2 warnings and 1 error generated.
--
   In file included from drivers/net/ethernet/apm/xgene-v2/main.c:10:
   In file included from drivers/net/ethernet/apm/xgene-v2/main.h:15:
   include/linux/efi.h:1050:20: error: redefinition of 'efi_capsule_pending'
   static inline bool efi_capsule_pending(int *reset_type) { return false; }
                      ^
   include/linux/efi.h:821:1: note: previous definition is here
   efi_capsule_pending(int *reset_type)
   ^
>> drivers/net/ethernet/apm/xgene-v2/main.c:661:42: warning: shift count >= width of type [-Wshift-count-overflow]
           ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
                                                   ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.

vim +2071 drivers/net/ethernet/apm/xgene/xgene_enet_main.c

1f3d62090d3ba4d Arnd Bergmann       2017-02-01  2012  
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2013  static int xgene_enet_probe(struct platform_device *pdev)
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2014  {
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2015  	struct net_device *ndev;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2016  	struct xgene_enet_pdata *pdata;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2017  	struct device *dev = &pdev->dev;
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2018  	void (*link_state)(struct work_struct *);
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2019  	const struct of_device_id *of_id;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2020  	int ret;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2021  
107dec2749fed1b Iyappan Subramanian 2016-02-17  2022  	ndev = alloc_etherdev_mqs(sizeof(struct xgene_enet_pdata),
5a44c71ccda60a5 Christophe JAILLET  2020-01-26  2023  				  XGENE_NUM_TX_RING, XGENE_NUM_RX_RING);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2024  	if (!ndev)
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2025  		return -ENOMEM;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2026  
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2027  	pdata = netdev_priv(ndev);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2028  
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2029  	pdata->pdev = pdev;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2030  	pdata->ndev = ndev;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2031  	SET_NETDEV_DEV(ndev, dev);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2032  	platform_set_drvdata(pdev, pdata);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2033  	ndev->netdev_ops = &xgene_ndev_ops;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2034  	xgene_enet_set_ethtool_ops(ndev);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2035  	ndev->features |= NETIF_F_IP_CSUM |
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2036  			  NETIF_F_GSO |
9b00eb494dc7c19 Iyappan Subramanian 2015-08-26  2037  			  NETIF_F_GRO |
9b00eb494dc7c19 Iyappan Subramanian 2015-08-26  2038  			  NETIF_F_SG;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2039  
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2040  	of_id = of_match_device(xgene_enet_of_match, &pdev->dev);
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2041  	if (of_id) {
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2042  		pdata->enet_id = (enum xgene_enet_id)of_id->data;
0738c54d63249bd Suman Tripathi      2015-06-23  2043  	}
0738c54d63249bd Suman Tripathi      2015-06-23  2044  #ifdef CONFIG_ACPI
0738c54d63249bd Suman Tripathi      2015-06-23  2045  	else {
0738c54d63249bd Suman Tripathi      2015-06-23  2046  		const struct acpi_device_id *acpi_id;
0738c54d63249bd Suman Tripathi      2015-06-23  2047  
0738c54d63249bd Suman Tripathi      2015-06-23  2048  		acpi_id = acpi_match_device(xgene_enet_acpi_match, &pdev->dev);
0738c54d63249bd Suman Tripathi      2015-06-23  2049  		if (acpi_id)
0738c54d63249bd Suman Tripathi      2015-06-23  2050  			pdata->enet_id = (enum xgene_enet_id) acpi_id->driver_data;
0738c54d63249bd Suman Tripathi      2015-06-23  2051  	}
0738c54d63249bd Suman Tripathi      2015-06-23  2052  #endif
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2053  	if (!pdata->enet_id) {
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2054  		ret = -ENODEV;
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2055  		goto err;
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2056  	}
bc1b7c132a09d84 Iyappan Subramanian 2015-04-28  2057  
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2058  	ret = xgene_enet_get_resources(pdata);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2059  	if (ret)
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2060  		goto err;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2061  
d0eb74582fa7b5c Iyappan Subramanian 2014-10-09  2062  	xgene_enet_setup_ops(pdata);
ae1aed95d0255aa Iyappan Subramanian 2017-05-10  2063  	spin_lock_init(&pdata->mac_lock);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2064  
9b00eb494dc7c19 Iyappan Subramanian 2015-08-26  2065  	if (pdata->phy_mode == PHY_INTERFACE_MODE_XGMII) {
0a0400c3094b5d5 Iyappan Subramanian 2017-03-15  2066  		ndev->features |= NETIF_F_TSO | NETIF_F_RXCSUM;
e3978673f514fa4 Iyappan Subramanian 2016-09-22  2067  		spin_lock_init(&pdata->mss_lock);
9b00eb494dc7c19 Iyappan Subramanian 2015-08-26  2068  	}
9b00eb494dc7c19 Iyappan Subramanian 2015-08-26  2069  	ndev->hw_features = ndev->features;
9b00eb494dc7c19 Iyappan Subramanian 2015-08-26  2070  
aeb20b6b3f4e1f8 Iyappan Subramanian 2015-11-23 @2071  	ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2072  	if (ret) {
aeb20b6b3f4e1f8 Iyappan Subramanian 2015-11-23  2073  		netdev_err(ndev, "No usable DMA configuration\n");
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2074  		goto err;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2075  	}
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2076  
183db4812794375 Quan Nguyen         2017-08-29  2077  	xgene_enet_check_phy_handle(pdata);
183db4812794375 Quan Nguyen         2017-08-29  2078  
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2079  	ret = xgene_enet_init_hw(pdata);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2080  	if (ret)
183db4812794375 Quan Nguyen         2017-08-29  2081  		goto err2;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2082  
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2083  	link_state = pdata->mac_ops->link_state;
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2084  	if (pdata->phy_mode == PHY_INTERFACE_MODE_XGMII) {
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2085  		INIT_DELAYED_WORK(&pdata->link_work, link_state);
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2086  	} else if (!pdata->mdio_driver) {
326dde3e3b2ed05 Iyappan Subramanian 2017-05-18  2087  		if (phy_interface_mode_is_rgmii(pdata->phy_mode))
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2088  			ret = xgene_enet_mdio_config(pdata);
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2089  		else
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2090  			INIT_DELAYED_WORK(&pdata->link_work, link_state);
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2091  
8089a96f601bdfe Iyappan Subramanian 2016-07-25  2092  		if (ret)
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2093  			goto err1;
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2094  	}
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2095  
2d07d8e4f0536e8 Quan Nguyen         2017-05-10  2096  	spin_lock_init(&pdata->stats_lock);
2d07d8e4f0536e8 Quan Nguyen         2017-05-10  2097  	ret = xgene_extd_stats_init(pdata);
2d07d8e4f0536e8 Quan Nguyen         2017-05-10  2098  	if (ret)
183db4812794375 Quan Nguyen         2017-08-29  2099  		goto err1;
2d07d8e4f0536e8 Quan Nguyen         2017-05-10  2100  
aeb20b6b3f4e1f8 Iyappan Subramanian 2015-11-23  2101  	xgene_enet_napi_add(pdata);
cb0366b7c16427a Iyappan Subramanian 2016-07-25  2102  	ret = register_netdev(ndev);
cb0366b7c16427a Iyappan Subramanian 2016-07-25  2103  	if (ret) {
cb0366b7c16427a Iyappan Subramanian 2016-07-25  2104  		netdev_err(ndev, "Failed to register netdev\n");
183db4812794375 Quan Nguyen         2017-08-29  2105  		goto err1;
cb0366b7c16427a Iyappan Subramanian 2016-07-25  2106  	}
cb0366b7c16427a Iyappan Subramanian 2016-07-25  2107  
aeb20b6b3f4e1f8 Iyappan Subramanian 2015-11-23  2108  	return 0;
cb0366b7c16427a Iyappan Subramanian 2016-07-25  2109  
183db4812794375 Quan Nguyen         2017-08-29  2110  err1:
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2111  	/*
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2112  	 * If necessary, free_netdev() will call netif_napi_del() and undo
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2113  	 * the effects of xgene_enet_napi_add()'s calls to netif_napi_add().
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2114  	 */
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2115  
183db4812794375 Quan Nguyen         2017-08-29  2116  	xgene_enet_delete_desc_rings(pdata);
183db4812794375 Quan Nguyen         2017-08-29  2117  
183db4812794375 Quan Nguyen         2017-08-29  2118  err2:
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2119  	if (pdata->mdio_driver)
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2120  		xgene_enet_phy_disconnect(pdata);
326dde3e3b2ed05 Iyappan Subramanian 2017-05-18  2121  	else if (phy_interface_mode_is_rgmii(pdata->phy_mode))
cecd6e510c65b25 Iyappan Subramanian 2016-08-12  2122  		xgene_enet_mdio_remove(pdata);
20decb7e486d7ee Matthias Brugger    2016-05-03  2123  err:
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2124  	free_netdev(ndev);
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2125  	return ret;
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2126  }
e6ad767305eb6ea Iyappan Subramanian 2014-08-07  2127  

:::::: The code at line 2071 was first introduced by commit
:::::: aeb20b6b3f4e1f88ce6a2802dabc667b607412ef drivers: net: xgene: fix: ifconfig up/down crash

:::::: TO: Iyappan Subramanian <isubramanian@xxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux