Commit 6adc5cac authored by Tejun Heo's avatar Tejun Heo

percpu: disallow archs from overriding SHIFT_PERCPU_PTR()

It has been about half a decade since all archs started using the
dynamic percpu allocator and thus the same SHIFT_PERCPU_PTR()
implementation.  There's no benefit in overriding SHIFT_PERCPU_PTR()
anymore.

Remove #ifndef around it to clarify that this is identical regardless
of the arch.

This patch doesn't cause any functional difference.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarChristoph Lameter <cl@linux.com>
parent ebe06187
...@@ -36,17 +36,14 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; ...@@ -36,17 +36,14 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
#endif #endif
/* /*
* Add a offset to a pointer but keep the pointer as is. * Add an offset to a pointer but keep the pointer as-is. Use RELOC_HIDE()
* * to prevent the compiler from making incorrect assumptions about the
* Only S390 provides its own means of moving the pointer. * pointer value. The weird cast keeps both GCC and sparse happy.
*/ */
#ifndef SHIFT_PERCPU_PTR
/* Weird cast keeps both GCC and sparse happy. */
#define SHIFT_PERCPU_PTR(__p, __offset) ({ \ #define SHIFT_PERCPU_PTR(__p, __offset) ({ \
__verify_pcpu_ptr((__p)); \ __verify_pcpu_ptr((__p)); \
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)); \ RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)); \
}) })
#endif
/* /*
* A percpu variable may point to a discarded regions. The following are * A percpu variable may point to a discarded regions. The following are
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment