[linux-next:master 1849/2075] drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse: sparse: incorrect type in initializer (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:   6dc544b66971c7f9909ff038b62149105272d26a
commit: 2ba9d29c44cc046b46c275d654fa946a0781a540 [1849/2075] mtd: nand: mxc_nand: support software ECC
config: nios2-randconfig-r133-20240528 (https://download.01.org/0day-ci/archive/20240528/202405282036.maEDO54Q-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240528/202405282036.maEDO54Q-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/202405282036.maEDO54Q-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned short [noderef] [usertype] __iomem *t @@     got void *buf @@
   drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse:     expected unsigned short [noderef] [usertype] __iomem *t
   drivers/mtd/nand/raw/mxc_nand.c:1479:26: sparse:     got void *buf
>> drivers/mtd/nand/raw/mxc_nand.c:1516:65: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *buf @@     got void [noderef] __iomem * @@
   drivers/mtd/nand/raw/mxc_nand.c:1516:65: sparse:     expected void *buf
   drivers/mtd/nand/raw/mxc_nand.c:1516:65: sparse:     got void [noderef] __iomem *
   drivers/mtd/nand/raw/mxc_nand.c:1527:87: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *buf @@     got void [noderef] __iomem * @@
   drivers/mtd/nand/raw/mxc_nand.c:1527:87: sparse:     expected void *buf
   drivers/mtd/nand/raw/mxc_nand.c:1527:87: sparse:     got void [noderef] __iomem *

vim +1479 drivers/mtd/nand/raw/mxc_nand.c

  1476	
  1477	static void memff16_toio(void *buf, int n)
  1478	{
> 1479		__iomem u16 *t = buf;
  1480		int i;
  1481	
  1482		for (i = 0; i < (n >> 1); i++)
  1483			__raw_writew(0xffff, t++);
  1484	}
  1485	
  1486	static void copy_page_to_sram(struct mtd_info *mtd, const void *buf, int buf_len)
  1487	{
  1488		struct nand_chip *this = mtd_to_nand(mtd);
  1489		struct mxc_nand_host *host = nand_get_controller_data(this);
  1490		unsigned int no_subpages = mtd->writesize / 512;
  1491		int oob_per_subpage, i;
  1492	
  1493		oob_per_subpage = (mtd->oobsize / no_subpages) & ~1;
  1494	
  1495		/*
  1496		 * During a page write the i.MX NAND controller will read 512b from
  1497		 * main_area0 SRAM, then oob_per_subpage bytes from spare0 SRAM, then
  1498		 * 512b from main_area1 SRAM and so on until the full page is written.
  1499		 * For software ECC we want to have a 1:1 mapping between the raw page
  1500		 * data on the NAND chip and the view of the NAND core. This is
  1501		 * necessary to make the NAND_CMD_RNDOUT read the data it expects.
  1502		 * To accomplish this we have to write the data in the order the controller
  1503		 * reads it. This is reversed in copy_page_from_sram() below.
  1504		 *
  1505		 * buf_len can either be the full page including the OOB or user data only.
  1506		 * When it's user data only make sure that we fill up the rest of the
  1507		 * SRAM with 0xff.
  1508		 */
  1509		for (i = 0; i < no_subpages; i++) {
  1510			int now = min(buf_len, 512);
  1511	
  1512			if (now)
  1513				memcpy16_toio(host->main_area0 + i * 512, buf, now);
  1514	
  1515			if (now < 512)
> 1516				memff16_toio(host->main_area0 + i * 512 + now, 512 - now);
  1517	
  1518			buf += 512;
  1519			buf_len -= now;
  1520	
  1521			now = min(buf_len, oob_per_subpage);
  1522			if (now)
  1523				memcpy16_toio(host->spare0 + i * host->devtype_data->spare_len,
  1524					      buf, now);
  1525	
  1526			if (now < oob_per_subpage)
  1527				memff16_toio(host->spare0 + i * host->devtype_data->spare_len + now,
  1528					     oob_per_subpage - now);
  1529	
  1530			buf += oob_per_subpage;
  1531			buf_len -= now;
  1532		}
  1533	}
  1534	

-- 
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