[linux-next:master 8629/9613] drivers/tty/serial/mxs-auart.c:1656:15: warning: cast to smaller integer type 'enum mxs_auart_type' from 'const void

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

 



Hi Fabio,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c6b11acc5f85b6e11d128fad8e0b7b223aa7e33f
commit: 5f1697fee6f6758ec1001569ae26d7a70a8bbc8e [8629/9613] serial: mxs-auart: Remove unneeded platform_device_id
config: powerpc-randconfig-r006-20201130 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project dfcf1acf13226be0f599a7ab6b395b66dc9545d6)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5f1697fee6f6758ec1001569ae26d7a70a8bbc8e
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 5f1697fee6f6758ec1001569ae26d7a70a8bbc8e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

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

All warnings (new ones prefixed by >>):

>> drivers/tty/serial/mxs-auart.c:1656:15: warning: cast to smaller integer type 'enum mxs_auart_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
           s->devtype = (enum mxs_auart_type)of_device_get_match_data(&pdev->dev);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.

vim +1656 drivers/tty/serial/mxs-auart.c

  1631	
  1632	static int mxs_auart_probe(struct platform_device *pdev)
  1633	{
  1634		struct mxs_auart_port *s;
  1635		u32 version;
  1636		int ret, irq;
  1637		struct resource *r;
  1638	
  1639		s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);
  1640		if (!s)
  1641			return -ENOMEM;
  1642	
  1643		s->port.dev = &pdev->dev;
  1644		s->dev = &pdev->dev;
  1645	
  1646		ret = serial_mxs_probe_dt(s, pdev);
  1647		if (ret > 0)
  1648			s->port.line = pdev->id < 0 ? 0 : pdev->id;
  1649		else if (ret < 0)
  1650			return ret;
  1651		if (s->port.line >= ARRAY_SIZE(auart_port)) {
  1652			dev_err(&pdev->dev, "serial%d out of range\n", s->port.line);
  1653			return -EINVAL;
  1654		}
  1655	
> 1656		s->devtype = (enum mxs_auart_type)of_device_get_match_data(&pdev->dev);
  1657	
  1658		ret = mxs_get_clks(s, pdev);
  1659		if (ret)
  1660			return ret;
  1661	
  1662		r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  1663		if (!r) {
  1664			ret = -ENXIO;
  1665			goto out_disable_clks;
  1666		}
  1667	
  1668		s->port.mapbase = r->start;
  1669		s->port.membase = ioremap(r->start, resource_size(r));
  1670		if (!s->port.membase) {
  1671			ret = -ENOMEM;
  1672			goto out_disable_clks;
  1673		}
  1674		s->port.ops = &mxs_auart_ops;
  1675		s->port.iotype = UPIO_MEM;
  1676		s->port.fifosize = MXS_AUART_FIFO_SIZE;
  1677		s->port.uartclk = clk_get_rate(s->clk);
  1678		s->port.type = PORT_IMX;
  1679		s->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_MXS_AUART_CONSOLE);
  1680	
  1681		mxs_init_regs(s);
  1682	
  1683		s->mctrl_prev = 0;
  1684	
  1685		irq = platform_get_irq(pdev, 0);
  1686		if (irq < 0) {
  1687			ret = irq;
  1688			goto out_iounmap;
  1689		}
  1690	
  1691		s->port.irq = irq;
  1692		ret = devm_request_irq(&pdev->dev, irq, mxs_auart_irq_handle, 0,
  1693				       dev_name(&pdev->dev), s);
  1694		if (ret)
  1695			goto out_iounmap;
  1696	
  1697		platform_set_drvdata(pdev, s);
  1698	
  1699		ret = mxs_auart_init_gpios(s, &pdev->dev);
  1700		if (ret) {
  1701			dev_err(&pdev->dev, "Failed to initialize GPIOs.\n");
  1702			goto out_iounmap;
  1703		}
  1704	
  1705		/*
  1706		 * Get the GPIO lines IRQ
  1707		 */
  1708		ret = mxs_auart_request_gpio_irq(s);
  1709		if (ret)
  1710			goto out_iounmap;
  1711	
  1712		auart_port[s->port.line] = s;
  1713	
  1714		mxs_auart_reset_deassert(s);
  1715	
  1716		ret = uart_add_one_port(&auart_driver, &s->port);
  1717		if (ret)
  1718			goto out_free_qpio_irq;
  1719	
  1720		/* ASM9260 don't have version reg */
  1721		if (is_asm9260_auart(s)) {
  1722			dev_info(&pdev->dev, "Found APPUART ASM9260\n");
  1723		} else {
  1724			version = mxs_read(s, REG_VERSION);
  1725			dev_info(&pdev->dev, "Found APPUART %d.%d.%d\n",
  1726				 (version >> 24) & 0xff,
  1727				 (version >> 16) & 0xff, version & 0xffff);
  1728		}
  1729	
  1730		return 0;
  1731	
  1732	out_free_qpio_irq:
  1733		mxs_auart_free_gpio_irq(s);
  1734		auart_port[pdev->id] = NULL;
  1735	
  1736	out_iounmap:
  1737		iounmap(s->port.membase);
  1738	
  1739	out_disable_clks:
  1740		if (is_asm9260_auart(s)) {
  1741			clk_disable_unprepare(s->clk);
  1742			clk_disable_unprepare(s->clk_ahb);
  1743		}
  1744		return ret;
  1745	}
  1746	

---
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]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux