mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: time: Add missing __iomem in get_cycles() and get_cycles_hi()
@ 2026-07-16  5:33 Nam Cao
  2026-07-19 17:59 ` Paul Walmsley
  0 siblings, 1 reply; 2+ messages in thread
From: Nam Cao @ 2026-07-16  5:33 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-riscv, linux-kernel
  Cc: Nam Cao, kernel test robot

__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>
---
 arch/riscv/include/asm/timex.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/include/asm/timex.h b/arch/riscv/include/asm/timex.h
index a06697846e69..d41acfb3959d 100644
--- a/arch/riscv/include/asm/timex.h
+++ b/arch/riscv/include/asm/timex.h
@@ -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 */
-- 
2.47.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] riscv: time: Add missing __iomem in get_cycles() and get_cycles_hi()
  2026-07-16  5:33 [PATCH] riscv: time: Add missing __iomem in get_cycles() and get_cycles_hi() Nam Cao
@ 2026-07-19 17:59 ` Paul Walmsley
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Walmsley @ 2026-07-19 17:59 UTC (permalink / raw)
  To: Nam Cao
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-riscv, linux-kernel, kernel test robot

On Thu, 16 Jul 2026, Nam Cao wrote:

> __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>

Thanks, queued for v7.2-rc.

\
- Paul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-19 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-16  5:33 [PATCH] riscv: time: Add missing __iomem in get_cycles() and get_cycles_hi() Nam Cao
2026-07-19 17:59 ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®