]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: time: Add missing __iomem in get_cycles() and get_cycles_hi()
authorNam Cao <namcao@linutronix.de>
Wed, 29 Jul 2026 17:43:28 +0000 (11:43 -0600)
committerPaul Walmsley <pjw@kernel.org>
Wed, 29 Jul 2026 17:43:28 +0000 (11:43 -0600)
__iomem is missing while calling readl_relaxed() in get_cycles() and
get_cycles_hi() and sparse complains.

Add __iomem to silence the sparse warnings.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202607160619.14G8GHp5-lkp@intel.com/
Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/20260716053319.2178937-1-namcao@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/timex.h

index a06697846e69521caceac2ae4d4e040d227d2ae7..d41acfb3959ddc046b3ad5dda542fdd7f12e1f03 100644 (file)
@@ -22,13 +22,13 @@ static inline cycles_t get_cycles(void)
 #else /* !CONFIG_64BIT */
 static inline u32 get_cycles(void)
 {
-       return readl_relaxed(((u32 *)clint_time_val));
+       return readl_relaxed(((u32 __iomem *)clint_time_val));
 }
 #define get_cycles get_cycles
 
 static inline u32 get_cycles_hi(void)
 {
-       return readl_relaxed(((u32 *)clint_time_val) + 1);
+       return readl_relaxed(((u32 __iomem *)clint_time_val) + 1);
 }
 #define get_cycles_hi get_cycles_hi
 #endif /* CONFIG_64BIT */