All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-review:UPDATE-20200509-044724/Wei-Yongjun/net-ethernet-ti-fix-error-return-code-in-am65_cpsw_nuss_probe/20200509-022521 1/1] drivers/net/ethernet/ti/am65-cpsw-nuss.c:2079:23: warning: passing argument 1 of 'ERR_PTR' makes integer from pointer without a cast
@ 2020-05-09  0:36 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-09  0:36 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20200509-044724/Wei-Yongjun/net-ethernet-ti-fix-error-return-code-in-am65_cpsw_nuss_probe/20200509-022521
head:   e56724e0982b09c5d076218f46b620b4cacc3b7b
commit: e56724e0982b09c5d076218f46b620b4cacc3b7b [1/1] net: ethernet: ti: fix some return value check of cpsw_ale_create()
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.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 e56724e0982b09c5d076218f46b620b4cacc3b7b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm64 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/ti/am65-cpsw-nuss.c: In function 'am65_cpsw_nuss_probe':
>> drivers/net/ethernet/ti/am65-cpsw-nuss.c:2079:23: warning: passing argument 1 of 'ERR_PTR' makes integer from pointer without a cast [-Wint-conversion]
    2079 |   ret = ERR_PTR(common->ale);
         |                 ~~~~~~^~~~~
         |                       |
         |                       struct cpsw_ale *
   In file included from include/linux/rwsem.h:18,
                    from include/linux/mm_types.h:11,
                    from include/linux/mmzone.h:21,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:10,
                    from include/linux/bvec.h:13,
                    from include/linux/skbuff.h:17,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/ethernet/ti/am65-cpsw-nuss.c:8:
   include/linux/err.h:24:48: note: expected 'long int' but argument is of type 'struct cpsw_ale *'
      24 | static inline void * __must_check ERR_PTR(long error)
         |                                           ~~~~~^~~~~
>> drivers/net/ethernet/ti/am65-cpsw-nuss.c:2079:7: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
    2079 |   ret = ERR_PTR(common->ale);
         |       ^

vim +/ERR_PTR +2079 drivers/net/ethernet/ti/am65-cpsw-nuss.c

  1972	
  1973	static int am65_cpsw_nuss_probe(struct platform_device *pdev)
  1974	{
  1975		struct cpsw_ale_params ale_params;
  1976		const struct of_device_id *of_id;
  1977		struct device *dev = &pdev->dev;
  1978		struct am65_cpsw_common *common;
  1979		struct device_node *node;
  1980		struct resource *res;
  1981		int ret, i;
  1982	
  1983		common = devm_kzalloc(dev, sizeof(struct am65_cpsw_common), GFP_KERNEL);
  1984		if (!common)
  1985			return -ENOMEM;
  1986		common->dev = dev;
  1987	
  1988		of_id = of_match_device(am65_cpsw_nuss_of_mtable, dev);
  1989		if (!of_id)
  1990			return -EINVAL;
  1991		common->pdata = of_id->data;
  1992	
  1993		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cpsw_nuss");
  1994		common->ss_base = devm_ioremap_resource(&pdev->dev, res);
  1995		if (IS_ERR(common->ss_base))
  1996			return PTR_ERR(common->ss_base);
  1997		common->cpsw_base = common->ss_base + AM65_CPSW_CPSW_NU_BASE;
  1998	
  1999		node = of_get_child_by_name(dev->of_node, "ethernet-ports");
  2000		if (!node)
  2001			return -ENOENT;
  2002		common->port_num = of_get_child_count(node);
  2003		if (common->port_num < 1 || common->port_num > AM65_CPSW_MAX_PORTS)
  2004			return -ENOENT;
  2005		of_node_put(node);
  2006	
  2007		if (common->port_num != 1)
  2008			return -EOPNOTSUPP;
  2009	
  2010		common->rx_flow_id_base = -1;
  2011		init_completion(&common->tdown_complete);
  2012		common->tx_ch_num = 1;
  2013	
  2014		ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(48));
  2015		if (ret) {
  2016			dev_err(dev, "error setting dma mask: %d\n", ret);
  2017			return ret;
  2018		}
  2019	
  2020		common->ports = devm_kcalloc(dev, common->port_num,
  2021					     sizeof(*common->ports),
  2022					     GFP_KERNEL);
  2023		if (!common->ports)
  2024			return -ENOMEM;
  2025	
  2026		pm_runtime_enable(dev);
  2027		ret = pm_runtime_get_sync(dev);
  2028		if (ret < 0) {
  2029			pm_runtime_put_noidle(dev);
  2030			pm_runtime_disable(dev);
  2031			return ret;
  2032		}
  2033	
  2034		node = of_get_child_by_name(dev->of_node, "mdio");
  2035		if (!node) {
  2036			dev_warn(dev, "MDIO node not found\n");
  2037		} else if (of_device_is_available(node)) {
  2038			struct platform_device *mdio_pdev;
  2039	
  2040			mdio_pdev = of_platform_device_create(node, NULL, dev);
  2041			if (!mdio_pdev) {
  2042				ret = -ENODEV;
  2043				goto err_pm_clear;
  2044			}
  2045	
  2046			common->mdio_dev =  &mdio_pdev->dev;
  2047		}
  2048		of_node_put(node);
  2049	
  2050		am65_cpsw_nuss_get_ver(common);
  2051	
  2052		/* init tx channels */
  2053		ret = am65_cpsw_nuss_init_tx_chns(common);
  2054		if (ret)
  2055			goto err_of_clear;
  2056		ret = am65_cpsw_nuss_init_rx_chns(common);
  2057		if (ret)
  2058			goto err_of_clear;
  2059	
  2060		ret = am65_cpsw_nuss_init_host_p(common);
  2061		if (ret)
  2062			goto err_of_clear;
  2063	
  2064		ret = am65_cpsw_nuss_init_slave_ports(common);
  2065		if (ret)
  2066			goto err_of_clear;
  2067	
  2068		/* init common data */
  2069		ale_params.dev = dev;
  2070		ale_params.ale_ageout = AM65_CPSW_ALE_AGEOUT_DEFAULT;
  2071		ale_params.ale_entries = 0;
  2072		ale_params.ale_ports = common->port_num + 1;
  2073		ale_params.ale_regs = common->cpsw_base + AM65_CPSW_NU_ALE_BASE;
  2074		ale_params.nu_switch_ale = true;
  2075	
  2076		common->ale = cpsw_ale_create(&ale_params);
  2077		if (IS_ERR(common->ale)) {
  2078			dev_err(dev, "error initializing ale engine\n");
> 2079			ret = ERR_PTR(common->ale);
  2080			goto err_of_clear;
  2081		}
  2082	
  2083		ret = am65_cpsw_init_cpts(common);
  2084		if (ret)
  2085			goto err_of_clear;
  2086	
  2087		/* init ports */
  2088		for (i = 0; i < common->port_num; i++)
  2089			am65_cpsw_nuss_slave_disable_unused(&common->ports[i]);
  2090	
  2091		dev_set_drvdata(dev, common);
  2092	
  2093		ret = am65_cpsw_nuss_init_ndev_2g(common);
  2094		if (ret)
  2095			goto err_of_clear;
  2096	
  2097		ret = am65_cpsw_nuss_ndev_reg_2g(common);
  2098		if (ret)
  2099			goto err_of_clear;
  2100	
  2101		pm_runtime_put(dev);
  2102		return 0;
  2103	
  2104	err_of_clear:
  2105		of_platform_device_destroy(common->mdio_dev, NULL);
  2106	err_pm_clear:
  2107		pm_runtime_put_sync(dev);
  2108		pm_runtime_disable(dev);
  2109		return ret;
  2110	}
  2111	

---
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: 48830 bytes --]

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

only message in thread, other threads:[~2020-05-09  0:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09  0:36 [linux-review:UPDATE-20200509-044724/Wei-Yongjun/net-ethernet-ti-fix-error-return-code-in-am65_cpsw_nuss_probe/20200509-022521 1/1] drivers/net/ethernet/ti/am65-cpsw-nuss.c:2079:23: warning: passing argument 1 of 'ERR_PTR' makes integer from pointer without a cast kbuild 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.