mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: Remove the PER_CPU_OFFSET_SHIFT macro
@ 2025-10-15 22:56 Samuel Holland
  2025-10-18 16:01 ` patchwork-bot+linux-riscv
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Holland @ 2025-10-15 22:56 UTC (permalink / raw)
  To: Palmer Dabbelt, Paul Walmsley
  Cc: linux-riscv, Samuel Holland, Albert Ou, Alexandre Ghiti,
	Charlie Jenkins, Radim Krčmář,
	Thomas Huth, linux-kernel

__per_cpu_offset is an array of unsigned long, so we can reuse the
existing RISCV_LGPTR macro.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

 arch/riscv/include/asm/asm.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/riscv/include/asm/asm.h b/arch/riscv/include/asm/asm.h
index 8bd2a11382a3..ac28066bb564 100644
--- a/arch/riscv/include/asm/asm.h
+++ b/arch/riscv/include/asm/asm.h
@@ -84,15 +84,9 @@
 .endm
 
 #ifdef CONFIG_SMP
-#ifdef CONFIG_32BIT
-#define PER_CPU_OFFSET_SHIFT 2
-#else
-#define PER_CPU_OFFSET_SHIFT 3
-#endif
-
 .macro asm_per_cpu dst sym tmp
 	lw    \tmp, TASK_TI_CPU_NUM(tp)
-	slli  \tmp, \tmp, PER_CPU_OFFSET_SHIFT
+	slli  \tmp, \tmp, RISCV_LGPTR
 	la    \dst, __per_cpu_offset
 	add   \dst, \dst, \tmp
 	REG_L \tmp, 0(\dst)
-- 
2.47.2

base-commit: 5a6f65d1502551f84c158789e5d89299c78907c7
branch: up/percpu-shift

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

* Re: [PATCH] riscv: Remove the PER_CPU_OFFSET_SHIFT macro
  2025-10-15 22:56 [PATCH] riscv: Remove the PER_CPU_OFFSET_SHIFT macro Samuel Holland
@ 2025-10-18 16:01 ` patchwork-bot+linux-riscv
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-10-18 16:01 UTC (permalink / raw)
  To: Samuel Holland
  Cc: linux-riscv, palmer, pjw, aou, alex, charlie, rkrcmar, thuth,
	linux-kernel

Hello:

This patch was applied to riscv/linux.git (fixes)
by Paul Walmsley <pjw@kernel.org>:

On Wed, 15 Oct 2025 15:56:00 -0700 you wrote:
> __per_cpu_offset is an array of unsigned long, so we can reuse the
> existing RISCV_LGPTR macro.
> 
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
> ---
> 
>  arch/riscv/include/asm/asm.h | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Here is the summary with links:
  - riscv: Remove the PER_CPU_OFFSET_SHIFT macro
    https://git.kernel.org/riscv/c/768e054de01b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-10-18 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-15 22:56 [PATCH] riscv: Remove the PER_CPU_OFFSET_SHIFT macro Samuel Holland
2025-10-18 16:01 ` patchwork-bot+linux-riscv

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®