Re: [PATCH v2 4/5] arm64: mm: Convert to GENERIC_IOREMAP

From: kernel test robot
Date: Fri Apr 29 2022 - 19:17:16 EST

Hi Kefeng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on hnaz-mm/master arnd-asm-generic/master v5.18-rc4 next-20220429]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in]

base: for-next/core
config: arm64-randconfig-s032-20220429 (
compiler: aarch64-linux-gcc (GCC) 11.3.0
wget -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
git remote add linux-review
git fetch --no-tags linux-review Kefeng-Wang/arm64-Cleanup-ioremap-and-support-ioremap_prot/20220429-182215
git checkout 77442d1fe8ed26b996b2b7d4464443a63097c434
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/

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

sparse warnings: (new ones prefixed by >>)
>> arch/arm64/mm/ioremap.c:14:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __iomem * @@ got void * @@
arch/arm64/mm/ioremap.c:14:31: sparse: expected void [noderef] __iomem *
arch/arm64/mm/ioremap.c:14:31: sparse: got void *
arch/arm64/mm/ioremap.c:18:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __iomem * @@ got void * @@
arch/arm64/mm/ioremap.c:18:31: sparse: expected void [noderef] __iomem *
arch/arm64/mm/ioremap.c:18:31: sparse: got void *
arch/arm64/mm/ioremap.c:29:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *x @@ got void [noderef] __iomem *addr @@
arch/arm64/mm/ioremap.c:29:32: sparse: expected void const *x
arch/arm64/mm/ioremap.c:29:32: sparse: got void [noderef] __iomem *addr

vim +14 arch/arm64/mm/ioremap.c

7 void __iomem *arch_ioremap(phys_addr_t phys_addr, size_t size, unsigned long prot)
8 {
9 unsigned long last_addr = phys_addr + size - 1;
10 int ret = -EINVAL;
12 /* Don't allow outside PHYS_MASK */
13 if (last_addr & ~PHYS_MASK)
> 14 return ERR_PTR(ret);
16 /* Don't allow RAM to be mapped. */
17 if (WARN_ON(pfn_is_map_memory(__phys_to_pfn(phys_addr))))
18 return ERR_PTR(ret);
20 return NULL;
21 }

0-DAY CI Kernel Test Service