[linux-next:master 11265/12481] drivers/net/ethernet/cirrus/ep93xx_eth.c:805:40: sparse: sparse: incorrect type in argument 2 (different address spaces)

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   62f92d634458a1e308bb699986b9147a6d670457
commit: 770e709e38bf90d3144d82218550730290bc1918 [11265/12481] net: cirrus: add DT support for Cirrus EP93xx
config: arm-randconfig-r112-20240921 (https://download.01.org/0day-ci/archive/20240921/202409212354.9CiUem7B-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 8663a75fa2f31299ab8d1d90288d9df92aadee88)
reproduce: (https://download.01.org/0day-ci/archive/20240921/202409212354.9CiUem7B-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409212354.9CiUem7B-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/cirrus/ep93xx_eth.c:805:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected unsigned char const [usertype] *addr @@     got void [noderef] __iomem * @@
   drivers/net/ethernet/cirrus/ep93xx_eth.c:805:40: sparse:     expected unsigned char const [usertype] *addr
   drivers/net/ethernet/cirrus/ep93xx_eth.c:805:40: sparse:     got void [noderef] __iomem *

vim +805 drivers/net/ethernet/cirrus/ep93xx_eth.c

   766	
   767	static int ep93xx_eth_probe(struct platform_device *pdev)
   768	{
   769		struct net_device *dev;
   770		struct ep93xx_priv *ep;
   771		struct resource *mem;
   772		void __iomem *base_addr;
   773		struct device_node *np;
   774		u32 phy_id;
   775		int irq;
   776		int err;
   777	
   778		if (pdev == NULL)
   779			return -ENODEV;
   780	
   781		mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   782		irq = platform_get_irq(pdev, 0);
   783		if (!mem || irq < 0)
   784			return -ENXIO;
   785	
   786		base_addr = ioremap(mem->start, resource_size(mem));
   787		if (!base_addr)
   788			return dev_err_probe(&pdev->dev, -EIO, "Failed to ioremap ethernet registers\n");
   789	
   790		np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
   791		if (!np)
   792			return dev_err_probe(&pdev->dev, -ENODEV, "Please provide \"phy-handle\"\n");
   793	
   794		err = of_property_read_u32(np, "reg", &phy_id);
   795		of_node_put(np);
   796		if (err)
   797			return dev_err_probe(&pdev->dev, -ENOENT, "Failed to locate \"phy_id\"\n");
   798	
   799		dev = alloc_etherdev(sizeof(struct ep93xx_priv));
   800		if (dev == NULL) {
   801			err = -ENOMEM;
   802			goto err_out;
   803		}
   804	
 > 805		eth_hw_addr_set(dev, base_addr + 0x50);
   806		dev->ethtool_ops = &ep93xx_ethtool_ops;
   807		dev->netdev_ops = &ep93xx_netdev_ops;
   808		dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
   809	
   810		ep = netdev_priv(dev);
   811		ep->dev = dev;
   812		SET_NETDEV_DEV(dev, &pdev->dev);
   813		netif_napi_add(dev, &ep->napi, ep93xx_poll);
   814	
   815		platform_set_drvdata(pdev, dev);
   816	
   817		ep->res = request_mem_region(mem->start, resource_size(mem),
   818					     dev_name(&pdev->dev));
   819		if (ep->res == NULL) {
   820			dev_err(&pdev->dev, "Could not reserve memory region\n");
   821			err = -ENOMEM;
   822			goto err_out;
   823		}
   824	
   825		ep->base_addr = base_addr;
   826		ep->irq = irq;
   827	
   828		ep->mii.phy_id = phy_id;
   829		ep->mii.phy_id_mask = 0x1f;
   830		ep->mii.reg_num_mask = 0x1f;
   831		ep->mii.dev = dev;
   832		ep->mii.mdio_read = ep93xx_mdio_read;
   833		ep->mii.mdio_write = ep93xx_mdio_write;
   834		ep->mdc_divisor = 40;	/* Max HCLK 100 MHz, min MDIO clk 2.5 MHz.  */
   835	
   836		if (is_zero_ether_addr(dev->dev_addr))
   837			eth_hw_addr_random(dev);
   838	
   839		err = register_netdev(dev);
   840		if (err) {
   841			dev_err(&pdev->dev, "Failed to register netdev\n");
   842			goto err_out;
   843		}
   844	
   845		printk(KERN_INFO "%s: ep93xx on-chip ethernet, IRQ %d, %pM\n",
   846				dev->name, ep->irq, dev->dev_addr);
   847	
   848		return 0;
   849	
   850	err_out:
   851		ep93xx_eth_remove(pdev);
   852		return err;
   853	}
   854	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




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

  Powered by Linux