linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] percpu: Merge VERIFY_PERCPU_PTR() into its only user
@ 2024-10-21  8:07 Uros Bizjak
  2024-10-21  8:07 ` [PATCH 2/3] percpu: Introduce PERCPU_PTR() macro Uros Bizjak
  2024-10-21  8:07 ` [PATCH 3/3] percpu: Cast percpu pointer in PERCPU_PTR() via unsigned long Uros Bizjak
  0 siblings, 2 replies; 8+ messages in thread
From: Uros Bizjak @ 2024-10-21  8:07 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Uros Bizjak, Dennis Zhou, Tejun Heo, Christoph Lameter, Andrew Morton

Merge VERIFY_PERCPU_PTR() into non-CONFIG_SMP per_cpu_ptr()
to make macro similar to CONFIG_SMP per_cpu_ptr(). This will
allow a follow-up patch to refactor common code to a macro.

No functional changes, non-CONFIG_SMP per_cpu_ptr() was
the only user of VERIFY_PERCPU_PTR().

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 include/linux/percpu-defs.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 8efce7414fad..7fa88c5f4b26 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -254,13 +254,13 @@ do {									\
 
 #else	/* CONFIG_SMP */
 
-#define VERIFY_PERCPU_PTR(__p)						\
+#define per_cpu_ptr(ptr, cpu)						\
 ({									\
-	__verify_pcpu_ptr(__p);						\
-	(typeof(*(__p)) __kernel __force *)(__p);			\
+	(void)(cpu);							\
+	__verify_pcpu_ptr(ptr);						\
+	(typeof(*(ptr)) __kernel __force *)(ptr);			\
 })
 
-#define per_cpu_ptr(ptr, cpu)	({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
 #define raw_cpu_ptr(ptr)	per_cpu_ptr(ptr, 0)
 #define this_cpu_ptr(ptr)	raw_cpu_ptr(ptr)
 
-- 
2.47.0



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

end of thread, other threads:[~2024-12-18  8:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21  8:07 [PATCH 1/3] percpu: Merge VERIFY_PERCPU_PTR() into its only user Uros Bizjak
2024-10-21  8:07 ` [PATCH 2/3] percpu: Introduce PERCPU_PTR() macro Uros Bizjak
2024-10-21 16:42   ` Christoph Lameter (Ampere)
2024-10-21  8:07 ` [PATCH 3/3] percpu: Cast percpu pointer in PERCPU_PTR() via unsigned long Uros Bizjak
2024-12-18  7:54   ` Gal Pressman
2024-12-18  8:40     ` Uros Bizjak
2024-12-18  8:46       ` Gal Pressman
2024-12-18  8:52         ` Uros Bizjak

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