tree:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
linux-5.4.y
head: a3e34830d91255b6038c86c49a880c59a1aba945
commit: 2cd065b916811dc197b0d0069cec2f64f7203af0 [342/3218] serial: mxs-auart: add missed
iounmap() in probe failure and remove
config: openrisc-randconfig-s031-20201116 (attached as .config)
compiler: or1k-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
# apt-get install sparse
# sparse version: v0.6.3-107-gaf3512a6-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gi...
git remote add linux-stable-rc
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-5.4.y
git checkout 2cd065b916811dc197b0d0069cec2f64f7203af0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
> drivers/tty/serial/mxs-auart.c:1753:24: sparse: sparse: incorrect
type in argument 1 (different address spaces) @@ expected void *addr @@ got
unsigned char [noderef] <asn:2> *membase @@
drivers/tty/serial/mxs-auart.c:1753:24: sparse: expected void *addr
> drivers/tty/serial/mxs-auart.c:1753:24: sparse: got unsigned
char [noderef] <asn:2> *membase
drivers/tty/serial/mxs-auart.c:1770:24:
sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected
void *addr @@ got unsigned char [noderef] <asn:2> *membase @@
drivers/tty/serial/mxs-auart.c:1770:24: sparse: expected void *addr
drivers/tty/serial/mxs-auart.c:1770:24: sparse: got unsigned char [noderef]
<asn:2> *membase
drivers/tty/serial/mxs-auart.c: note: in included file (through
arch/openrisc/include/asm/io.h, include/linux/io.h, include/linux/irq.h, ...):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
vim +1753 drivers/tty/serial/mxs-auart.c
1643
1644 static int mxs_auart_probe(struct platform_device *pdev)
1645 {
1646 const struct of_device_id *of_id =
1647 of_match_device(mxs_auart_dt_ids, &pdev->dev);
1648 struct mxs_auart_port *s;
1649 u32 version;
1650 int ret, irq;
1651 struct resource *r;
1652
1653 s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);
1654 if (!s)
1655 return -ENOMEM;
1656
1657 s->port.dev = &pdev->dev;
1658 s->dev = &pdev->dev;
1659
1660 ret = serial_mxs_probe_dt(s, pdev);
1661 if (ret > 0)
1662 s->port.line = pdev->id < 0 ? 0 : pdev->id;
1663 else if (ret < 0)
1664 return ret;
1665 if (s->port.line >= ARRAY_SIZE(auart_port)) {
1666 dev_err(&pdev->dev, "serial%d out of range\n",
s->port.line);
1667 return -EINVAL;
1668 }
1669
1670 if (of_id) {
1671 pdev->id_entry = of_id->data;
1672 s->devtype = pdev->id_entry->driver_data;
1673 }
1674
1675 ret = mxs_get_clks(s, pdev);
1676 if (ret)
1677 return ret;
1678
1679 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1680 if (!r) {
1681 ret = -ENXIO;
1682 goto out_disable_clks;
1683 }
1684
1685 s->port.mapbase = r->start;
1686 s->port.membase = ioremap(r->start, resource_size(r));
1687 if (!s->port.membase) {
1688 ret = -ENOMEM;
1689 goto out_disable_clks;
1690 }
1691 s->port.ops = &mxs_auart_ops;
1692 s->port.iotype = UPIO_MEM;
1693 s->port.fifosize = MXS_AUART_FIFO_SIZE;
1694 s->port.uartclk = clk_get_rate(s->clk);
1695 s->port.type = PORT_IMX;
1696
1697 mxs_init_regs(s);
1698
1699 s->mctrl_prev = 0;
1700
1701 irq = platform_get_irq(pdev, 0);
1702 if (irq < 0) {
1703 ret = irq;
1704 goto out_iounmap;
1705 }
1706
1707 s->port.irq = irq;
1708 ret = devm_request_irq(&pdev->dev, irq, mxs_auart_irq_handle, 0,
1709 dev_name(&pdev->dev), s);
1710 if (ret)
1711 goto out_iounmap;
1712
1713 platform_set_drvdata(pdev, s);
1714
1715 ret = mxs_auart_init_gpios(s, &pdev->dev);
1716 if (ret) {
1717 dev_err(&pdev->dev, "Failed to initialize GPIOs.\n");
1718 goto out_iounmap;
1719 }
1720
1721 /*
1722 * Get the GPIO lines IRQ
1723 */
1724 ret = mxs_auart_request_gpio_irq(s);
1725 if (ret)
1726 goto out_iounmap;
1727
1728 auart_port[s->port.line] = s;
1729
1730 mxs_auart_reset_deassert(s);
1731
1732 ret = uart_add_one_port(&auart_driver, &s->port);
1733 if (ret)
1734 goto out_free_qpio_irq;
1735
1736 /* ASM9260 don't have version reg */
1737 if (is_asm9260_auart(s)) {
1738 dev_info(&pdev->dev, "Found APPUART ASM9260\n");
1739 } else {
1740 version = mxs_read(s, REG_VERSION);
1741 dev_info(&pdev->dev, "Found APPUART %d.%d.%d\n",
1742 (version >> 24) & 0xff,
1743 (version >> 16) & 0xff, version & 0xffff);
1744 }
1745
1746 return 0;
1747
1748 out_free_qpio_irq:
1749 mxs_auart_free_gpio_irq(s);
1750 auart_port[pdev->id] = NULL;
1751
1752 out_iounmap:
1753 iounmap(s->port.membase);
1754
1755 out_disable_clks:
1756 if (is_asm9260_auart(s)) {
1757 clk_disable_unprepare(s->clk);
1758 clk_disable_unprepare(s->clk_ahb);
1759 }
1760 return ret;
1761 }
1762
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org