mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
percpu: reorder macros in percpu header files
* In include/asm-generic/percpu.h, collect {raw|_this}_cpu_generic*() macros into one place. They were dispersed through {raw|this}_cpu_*_N() definitions and the visiual inconsistency was making following the code unnecessarily difficult. * In include/linux/percpu-defs.h, move __verify_pcpu_ptr() later in the file so that it's right above accessor definitions where it's actually used. This is pure reorganization. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Christoph Lameter <cl@linux.com>
This commit is contained in:
@@ -52,19 +52,6 @@
|
||||
#define __PCPU_DUMMY_ATTRS \
|
||||
__attribute__((section(".discard"), unused))
|
||||
|
||||
/*
|
||||
* Macro which verifies @ptr is a percpu pointer without evaluating
|
||||
* @ptr. This is to be used in percpu accessors to verify that the
|
||||
* input parameter is a percpu pointer.
|
||||
*
|
||||
* + 0 is required in order to convert the pointer type from a
|
||||
* potential array type to a pointer to a single item of the array.
|
||||
*/
|
||||
#define __verify_pcpu_ptr(ptr) do { \
|
||||
const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
|
||||
(void)__vpp_verify; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* s390 and alpha modules require percpu variables to be defined as
|
||||
* weak to force the compiler to generate GOT based external
|
||||
@@ -203,6 +190,19 @@
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/*
|
||||
* Macro which verifies @ptr is a percpu pointer without evaluating
|
||||
* @ptr. This is to be used in percpu accessors to verify that the
|
||||
* input parameter is a percpu pointer.
|
||||
*
|
||||
* + 0 is required in order to convert the pointer type from a
|
||||
* potential array type to a pointer to a single item of the array.
|
||||
*/
|
||||
#define __verify_pcpu_ptr(ptr) do { \
|
||||
const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
|
||||
(void)__vpp_verify; \
|
||||
} while (0)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user