]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
percpu: disallow archs from overriding SHIFT_PERCPU_PTR()
authorTejun Heo <tj@kernel.org>
Tue, 17 Jun 2014 23:12:33 +0000 (19:12 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 17 Jun 2014 23:12:33 +0000 (19:12 -0400)
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: Tejun Heo <tj@kernel.org>
Acked-by: Christoph Lameter <cl@linux.com>
include/asm-generic/percpu.h

index 0703aa75b5e8eda4c8f469a74925e171804bdd92..63d2b68c826e59c7513d12984358ed2f836f09fc 100644 (file)
@@ -36,17 +36,14 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
 #endif
 
 /*
- * Add a offset to a pointer but keep the pointer as is.
- *
- * Only S390 provides its own means of moving the pointer.
+ * 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
+ * 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)        ({                              \
        __verify_pcpu_ptr((__p));                                       \
        RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)); \
 })
-#endif
 
 /*
  * A percpu variable may point to a discarded regions. The following are