All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 2888/4669] drivers/mtd/maps/uclinux.c:58:15: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2026-07-09 19:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-07-09 19:25 UTC (permalink / raw)
  To: Miquel Raynal; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b9810cd75b9fb56a3425d391cba3f608502bd474
commit: 2b533e775aec580cf60074417f4ca00ac9cf3580 [2888/4669] Revert "mtd: maps: remove uclinux map driver"
config: riscv-randconfig-r122-20260709 (https://download.01.org/0day-ci/archive/20260710/202607100227.esCbqJWc-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 14.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260710/202607100227.esCbqJWc-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607100227.esCbqJWc-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/maps/uclinux.c:58:15: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   drivers/mtd/maps/uclinux.c:58:15: sparse:     expected void *
   drivers/mtd/maps/uclinux.c:58:15: sparse:     got void [noderef] __iomem *
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
   drivers/mtd/maps/uclinux.c:80:30: sparse: sparse: cast to restricted __be32
>> drivers/mtd/maps/uclinux.c:92:20: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *virt @@     got void * @@
   drivers/mtd/maps/uclinux.c:92:20: sparse:     expected void [noderef] __iomem *virt
   drivers/mtd/maps/uclinux.c:92:20: sparse:     got void *
>> drivers/mtd/maps/uclinux.c:94:27: sparse: sparse: Using plain integer as NULL pointer

vim +58 drivers/mtd/maps/uclinux.c

    53	
    54	static int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len,
    55		size_t *retlen, void **virt, resource_size_t *phys)
    56	{
    57		struct map_info *map = mtd->priv;
  > 58		*virt = map->virt + from;
    59		if (phys)
    60			*phys = map->phys + from;
    61		*retlen = len;
    62		return(0);
    63	}
    64	
    65	/****************************************************************************/
    66	
    67	static int __init uclinux_mtd_init(void)
    68	{
    69		struct mtd_info *mtd;
    70		struct map_info *mapp;
    71	
    72		mapp = &uclinux_ram_map;
    73	
    74		if (physaddr == -1)
    75			mapp->phys = (resource_size_t)__bss_stop;
    76		else
    77			mapp->phys = physaddr;
    78	
    79		if (!mapp->size)
    80			mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(mapp->phys + 8))));
    81		mapp->bankwidth = 4;
    82	
    83		printk("uclinux[mtd]: probe address=0x%x size=0x%x\n",
    84		       	(int) mapp->phys, (int) mapp->size);
    85	
    86		/*
    87		 * The filesystem is guaranteed to be in direct mapped memory. It is
    88		 * directly following the kernels own bss region. Following the same
    89		 * mechanism used by architectures setting up traditional initrds we
    90		 * use phys_to_virt to get the virtual address of its start.
    91		 */
  > 92		mapp->virt = phys_to_virt(mapp->phys);
    93	
  > 94		if (mapp->virt == 0) {
    95			printk("uclinux[mtd]: no virtual mapping?\n");
    96			return(-EIO);
    97		}
    98	
    99		simple_map_init(mapp);
   100	
   101		mtd = do_map_probe("map_" MAP_NAME, mapp);
   102		if (!mtd) {
   103			printk("uclinux[mtd]: failed to find a mapping?\n");
   104			return(-ENXIO);
   105		}
   106	
   107		mtd->owner = THIS_MODULE;
   108		mtd->_point = uclinux_point;
   109		mtd->priv = mapp;
   110	
   111		uclinux_ram_mtdinfo = mtd;
   112		mtd_device_register(mtd, uclinux_romfs, NUM_PARTITIONS);
   113	
   114		return(0);
   115	}
   116	device_initcall(uclinux_mtd_init);
   117	

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

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

only message in thread, other threads:[~2026-07-09 19:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 19:25 [linux-next:master 2888/4669] drivers/mtd/maps/uclinux.c:58:15: sparse: sparse: incorrect type in assignment (different address spaces) kernel 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.