All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:606:7: warning: assignment to 'void *' from 'long int' makes pointer from integer without a cast
@ 2021-06-06 12:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-06 12:14 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10891 bytes --]

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20210606-183130/Matthew-Hagan/net-stmmac-explicitly-deassert-GMAC_AHB_RESET/20210606-014240
head:   91d2c35f96d76ea24b46c81cc6c969d5d2d9c497
commit: a2b590cdea95a5b6716e1ad242e5fed29c57b19d net: stmmac: explicitly deassert GMAC_AHB_RESET
date:   2 hours ago
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/a2b590cdea95a5b6716e1ad242e5fed29c57b19d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review UPDATE-20210606-183130/Matthew-Hagan/net-stmmac-explicitly-deassert-GMAC_AHB_RESET/20210606-014240
        git checkout a2b590cdea95a5b6716e1ad242e5fed29c57b19d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c: In function 'stmmac_probe_config_dt':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:606:7: warning: assignment to 'void *' from 'long int' makes pointer from integer without a cast [-Wint-conversion]
     606 |   ret = PTR_ERR(plat->stmmac_ahb_rst);
         |       ^


vim +606 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

   385	
   386	/**
   387	 * stmmac_probe_config_dt - parse device-tree driver parameters
   388	 * @pdev: platform_device structure
   389	 * @mac: MAC address to use
   390	 * Description:
   391	 * this function is to read the driver parameters from device-tree and
   392	 * set some private fields that will be used by the main at runtime.
   393	 */
   394	struct plat_stmmacenet_data *
   395	stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
   396	{
   397		struct device_node *np = pdev->dev.of_node;
   398		struct plat_stmmacenet_data *plat;
   399		struct stmmac_dma_cfg *dma_cfg;
   400		void *ret;
   401		int rc;
   402	
   403		plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
   404		if (!plat)
   405			return ERR_PTR(-ENOMEM);
   406	
   407		rc = of_get_mac_address(np, mac);
   408		if (rc) {
   409			if (rc == -EPROBE_DEFER)
   410				return ERR_PTR(rc);
   411	
   412			eth_zero_addr(mac);
   413		}
   414	
   415		plat->phy_interface = device_get_phy_mode(&pdev->dev);
   416		if (plat->phy_interface < 0)
   417			return ERR_PTR(plat->phy_interface);
   418	
   419		plat->interface = stmmac_of_get_mac_mode(np);
   420		if (plat->interface < 0)
   421			plat->interface = plat->phy_interface;
   422	
   423		/* Some wrapper drivers still rely on phy_node. Let's save it while
   424		 * they are not converted to phylink. */
   425		plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
   426	
   427		/* PHYLINK automatically parses the phy-handle property */
   428		plat->phylink_node = np;
   429	
   430		/* Get max speed of operation from device tree */
   431		if (of_property_read_u32(np, "max-speed", &plat->max_speed))
   432			plat->max_speed = -1;
   433	
   434		plat->bus_id = of_alias_get_id(np, "ethernet");
   435		if (plat->bus_id < 0)
   436			plat->bus_id = 0;
   437	
   438		/* Default to phy auto-detection */
   439		plat->phy_addr = -1;
   440	
   441		/* Default to get clk_csr from stmmac_clk_crs_set(),
   442		 * or get clk_csr from device tree.
   443		 */
   444		plat->clk_csr = -1;
   445		of_property_read_u32(np, "clk_csr", &plat->clk_csr);
   446	
   447		/* "snps,phy-addr" is not a standard property. Mark it as deprecated
   448		 * and warn of its use. Remove this when phy node support is added.
   449		 */
   450		if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
   451			dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
   452	
   453		/* To Configure PHY by using all device-tree supported properties */
   454		rc = stmmac_dt_phy(plat, np, &pdev->dev);
   455		if (rc)
   456			return ERR_PTR(rc);
   457	
   458		of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
   459	
   460		of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
   461	
   462		plat->force_sf_dma_mode =
   463			of_property_read_bool(np, "snps,force_sf_dma_mode");
   464	
   465		plat->en_tx_lpi_clockgating =
   466			of_property_read_bool(np, "snps,en-tx-lpi-clockgating");
   467	
   468		/* Set the maxmtu to a default of JUMBO_LEN in case the
   469		 * parameter is not present in the device tree.
   470		 */
   471		plat->maxmtu = JUMBO_LEN;
   472	
   473		/* Set default value for multicast hash bins */
   474		plat->multicast_filter_bins = HASH_TABLE_SIZE;
   475	
   476		/* Set default value for unicast filter entries */
   477		plat->unicast_filter_entries = 1;
   478	
   479		/*
   480		 * Currently only the properties needed on SPEAr600
   481		 * are provided. All other properties should be added
   482		 * once needed on other platforms.
   483		 */
   484		if (of_device_is_compatible(np, "st,spear600-gmac") ||
   485			of_device_is_compatible(np, "snps,dwmac-3.50a") ||
   486			of_device_is_compatible(np, "snps,dwmac-3.70a") ||
   487			of_device_is_compatible(np, "snps,dwmac")) {
   488			/* Note that the max-frame-size parameter as defined in the
   489			 * ePAPR v1.1 spec is defined as max-frame-size, it's
   490			 * actually used as the IEEE definition of MAC Client
   491			 * data, or MTU. The ePAPR specification is confusing as
   492			 * the definition is max-frame-size, but usage examples
   493			 * are clearly MTUs
   494			 */
   495			of_property_read_u32(np, "max-frame-size", &plat->maxmtu);
   496			of_property_read_u32(np, "snps,multicast-filter-bins",
   497					     &plat->multicast_filter_bins);
   498			of_property_read_u32(np, "snps,perfect-filter-entries",
   499					     &plat->unicast_filter_entries);
   500			plat->unicast_filter_entries = dwmac1000_validate_ucast_entries(
   501					&pdev->dev, plat->unicast_filter_entries);
   502			plat->multicast_filter_bins = dwmac1000_validate_mcast_bins(
   503					&pdev->dev, plat->multicast_filter_bins);
   504			plat->has_gmac = 1;
   505			plat->pmt = 1;
   506		}
   507	
   508		if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
   509		    of_device_is_compatible(np, "snps,dwmac-4.10a") ||
   510		    of_device_is_compatible(np, "snps,dwmac-4.20a") ||
   511		    of_device_is_compatible(np, "snps,dwmac-5.10a")) {
   512			plat->has_gmac4 = 1;
   513			plat->has_gmac = 0;
   514			plat->pmt = 1;
   515			plat->tso_en = of_property_read_bool(np, "snps,tso");
   516		}
   517	
   518		if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
   519			of_device_is_compatible(np, "snps,dwmac-3.710")) {
   520			plat->enh_desc = 1;
   521			plat->bugged_jumbo = 1;
   522			plat->force_sf_dma_mode = 1;
   523		}
   524	
   525		if (of_device_is_compatible(np, "snps,dwxgmac")) {
   526			plat->has_xgmac = 1;
   527			plat->pmt = 1;
   528			plat->tso_en = of_property_read_bool(np, "snps,tso");
   529		}
   530	
   531		dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
   532				       GFP_KERNEL);
   533		if (!dma_cfg) {
   534			stmmac_remove_config_dt(pdev, plat);
   535			return ERR_PTR(-ENOMEM);
   536		}
   537		plat->dma_cfg = dma_cfg;
   538	
   539		of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
   540		if (!dma_cfg->pbl)
   541			dma_cfg->pbl = DEFAULT_DMA_PBL;
   542		of_property_read_u32(np, "snps,txpbl", &dma_cfg->txpbl);
   543		of_property_read_u32(np, "snps,rxpbl", &dma_cfg->rxpbl);
   544		dma_cfg->pblx8 = !of_property_read_bool(np, "snps,no-pbl-x8");
   545	
   546		dma_cfg->aal = of_property_read_bool(np, "snps,aal");
   547		dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst");
   548		dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst");
   549	
   550		plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
   551		if (plat->force_thresh_dma_mode) {
   552			plat->force_sf_dma_mode = 0;
   553			dev_warn(&pdev->dev,
   554				 "force_sf_dma_mode is ignored if force_thresh_dma_mode is set.\n");
   555		}
   556	
   557		of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed);
   558	
   559		plat->axi = stmmac_axi_setup(pdev);
   560	
   561		rc = stmmac_mtl_setup(pdev, plat);
   562		if (rc) {
   563			stmmac_remove_config_dt(pdev, plat);
   564			return ERR_PTR(rc);
   565		}
   566	
   567		/* clock setup */
   568		if (!of_device_is_compatible(np, "snps,dwc-qos-ethernet-4.10")) {
   569			plat->stmmac_clk = devm_clk_get(&pdev->dev,
   570							STMMAC_RESOURCE_NAME);
   571			if (IS_ERR(plat->stmmac_clk)) {
   572				dev_warn(&pdev->dev, "Cannot get CSR clock\n");
   573				plat->stmmac_clk = NULL;
   574			}
   575			clk_prepare_enable(plat->stmmac_clk);
   576		}
   577	
   578		plat->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
   579		if (IS_ERR(plat->pclk)) {
   580			ret = plat->pclk;
   581			goto error_pclk_get;
   582		}
   583		clk_prepare_enable(plat->pclk);
   584	
   585		/* Fall-back to main clock in case of no PTP ref is passed */
   586		plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "ptp_ref");
   587		if (IS_ERR(plat->clk_ptp_ref)) {
   588			plat->clk_ptp_rate = clk_get_rate(plat->stmmac_clk);
   589			plat->clk_ptp_ref = NULL;
   590			dev_info(&pdev->dev, "PTP uses main clock\n");
   591		} else {
   592			plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref);
   593			dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate);
   594		}
   595	
   596		plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev,
   597								   STMMAC_RESOURCE_NAME);
   598		if (IS_ERR(plat->stmmac_rst)) {
   599			ret = plat->stmmac_rst;
   600			goto error_hw_init;
   601		}
   602	
   603		plat->stmmac_ahb_rst = devm_reset_control_get_optional_shared(
   604								&pdev->dev, "ahb");
   605		if (IS_ERR(plat->stmmac_ahb_rst)) {
 > 606			ret = PTR_ERR(plat->stmmac_ahb_rst);
   607			goto error_hw_init;
   608		}
   609	
   610		return plat;
   611	
   612	error_hw_init:
   613		clk_disable_unprepare(plat->pclk);
   614	error_pclk_get:
   615		clk_disable_unprepare(plat->stmmac_clk);
   616	
   617		return ret;
   618	}
   619	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 60642 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-06 12:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 12:14 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:606:7: warning: assignment to 'void *' from 'long int' makes pointer from integer without a cast kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.