arch/riscv/include/asm/timex.h:31:16: sparse: sparse: cast removes address space '__iomem' of expression
From: kernel test robot
Date: Wed Jun 03 2026 - 20:24:53 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
commit: c03ad15f7cf60999681a3e5784404a73a93e6506 riscv: Reuse measure_cycles() in check_vector_unaligned_access()
date: 9 weeks ago
config: riscv-randconfig-r111-20260604 (https://download.01.org/0day-ci/archive/20260604/202606040825.U6Sodwz8-lkp@xxxxxxxxx/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260604/202606040825.U6Sodwz8-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
| Fixes: c03ad15f7cf6 ("riscv: Reuse measure_cycles() in check_vector_unaligned_access()")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606040825.U6Sodwz8-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
WARNING: invalid argument to '-march': '_zabha'
arch/riscv/kernel/unaligned_access_speed.c:25:1: sparse: sparse: symbol '__pcpu_scope_vector_misaligned_access' was not declared. Should it be static?
arch/riscv/kernel/unaligned_access_speed.c: note: in included file (through include/linux/timex.h, include/linux/time32.h, include/linux/time.h, include/linux/jiffies.h, ...):
>> arch/riscv/include/asm/timex.h:31:16: sparse: sparse: cast removes address space '__iomem' of expression
>> arch/riscv/include/asm/timex.h:31:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
arch/riscv/include/asm/timex.h:31:16: sparse: expected void const volatile [noderef] __iomem *addr
arch/riscv/include/asm/timex.h:31:16: sparse: got unsigned int [usertype] *
>> arch/riscv/include/asm/timex.h:31:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
arch/riscv/include/asm/timex.h:31:16: sparse: expected void const volatile [noderef] __iomem *addr
arch/riscv/include/asm/timex.h:31:16: sparse: got unsigned int [usertype] *
arch/riscv/include/asm/timex.h:25:16: sparse: sparse: cast removes address space '__iomem' of expression
arch/riscv/include/asm/timex.h:25:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
arch/riscv/include/asm/timex.h:25:16: sparse: expected void const volatile [noderef] __iomem *addr
arch/riscv/include/asm/timex.h:25:16: sparse: got unsigned int [usertype] *
>> arch/riscv/include/asm/timex.h:31:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
arch/riscv/include/asm/timex.h:31:16: sparse: expected void const volatile [noderef] __iomem *addr
arch/riscv/include/asm/timex.h:31:16: sparse: got unsigned int [usertype] *
>> arch/riscv/include/asm/timex.h:31:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
arch/riscv/include/asm/timex.h:31:16: sparse: expected void const volatile [noderef] __iomem *addr
arch/riscv/include/asm/timex.h:31:16: sparse: got unsigned int [usertype] *
arch/riscv/include/asm/timex.h:25:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
arch/riscv/include/asm/timex.h:25:16: sparse: expected void const volatile [noderef] __iomem *addr
arch/riscv/include/asm/timex.h:25:16: sparse: got unsigned int [usertype] *
vim +/__iomem +31 arch/riscv/include/asm/timex.h
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 28
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 29 static inline u32 get_cycles_hi(void)
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 30 {
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 @31 return readl_relaxed(((u32 *)clint_time_val) + 1);
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 32 }
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 33 #define get_cycles_hi get_cycles_hi
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 34 #endif /* CONFIG_64BIT */
d5be89a8d118a8e Palmer Dabbelt 2020-09-14 35
:::::: The code at line 31 was first introduced by commit
:::::: d5be89a8d118a8e8d09cd74a921a808f17fbdd09 RISC-V: Resurrect the MMIO timer implementation for M-mode systems
:::::: TO: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
:::::: CC: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki