2024-03-31 16:09:36

by kernel test robot

[permalink] [raw]
Subject: arch/loongarch/kernel/relocate.c:166:38: sparse: sparse: incorrect type in initializer (different address spaces)

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 712e14250dd2907346617eba275c46f53db8fae7
commit: e5f02b51fa0cb785e352e77271a65e96051b789b LoongArch: Add support for kernel address space layout randomization (KASLR)
date: 1 year, 1 month ago
config: loongarch-randconfig-r034-20230511 (https://download.01.org/0day-ci/archive/20240331/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20240331/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> arch/loongarch/kernel/relocate.c:166:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char *cmdline @@ got void [noderef] __iomem * @@
arch/loongarch/kernel/relocate.c:166:38: sparse: expected char *cmdline
arch/loongarch/kernel/relocate.c:166:38: sparse: got void [noderef] __iomem *

vim +166 arch/loongarch/kernel/relocate.c

159
160 void * __init relocate_kernel(void)
161 {
162 unsigned long kernel_length;
163 unsigned long random_offset = 0;
164 void *location_new = _text; /* Default to original kernel start */
165 void *kernel_entry = start_kernel; /* Default to original kernel entry point */
> 166 char *cmdline = early_ioremap(fw_arg1, COMMAND_LINE_SIZE); /* Boot command line is passed in fw_arg1 */
167
168 strscpy(boot_command_line, cmdline, COMMAND_LINE_SIZE);
169

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