include/asm-x86/percpu.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Joe Perches 2008-03-23 01:03:06 -07:00 committed by Ingo Molnar
parent 46e1abc63e
commit bc9e3be20b

View file

@ -85,58 +85,62 @@ DECLARE_PER_CPU(unsigned long, this_cpu_off);
* don't give an lvalue though). */ * don't give an lvalue though). */
extern void __bad_percpu_size(void); extern void __bad_percpu_size(void);
#define percpu_to_op(op,var,val) \ #define percpu_to_op(op, var, val) \
do { \ do { \
typedef typeof(var) T__; \ typedef typeof(var) T__; \
if (0) { T__ tmp__; tmp__ = (val); } \ if (0) { \
switch (sizeof(var)) { \ T__ tmp__; \
case 1: \ tmp__ = (val); \
asm(op "b %1,"__percpu_seg"%0" \ } \
: "+m" (var) \ switch (sizeof(var)) { \
:"ri" ((T__)val)); \ case 1: \
break; \ asm(op "b %1,"__percpu_seg"%0" \
case 2: \ : "+m" (var) \
asm(op "w %1,"__percpu_seg"%0" \ : "ri" ((T__)val)); \
: "+m" (var) \ break; \
:"ri" ((T__)val)); \ case 2: \
break; \ asm(op "w %1,"__percpu_seg"%0" \
case 4: \ : "+m" (var) \
asm(op "l %1,"__percpu_seg"%0" \ : "ri" ((T__)val)); \
: "+m" (var) \ break; \
:"ri" ((T__)val)); \ case 4: \
break; \ asm(op "l %1,"__percpu_seg"%0" \
default: __bad_percpu_size(); \ : "+m" (var) \
} \ : "ri" ((T__)val)); \
} while (0) break; \
default: __bad_percpu_size(); \
} \
} while (0)
#define percpu_from_op(op,var) \ #define percpu_from_op(op, var) \
({ \ ({ \
typeof(var) ret__; \ typeof(var) ret__; \
switch (sizeof(var)) { \ switch (sizeof(var)) { \
case 1: \ case 1: \
asm(op "b "__percpu_seg"%1,%0" \ asm(op "b "__percpu_seg"%1,%0" \
: "=r" (ret__) \ : "=r" (ret__) \
: "m" (var)); \ : "m" (var)); \
break; \ break; \
case 2: \ case 2: \
asm(op "w "__percpu_seg"%1,%0" \ asm(op "w "__percpu_seg"%1,%0" \
: "=r" (ret__) \ : "=r" (ret__) \
: "m" (var)); \ : "m" (var)); \
break; \ break; \
case 4: \ case 4: \
asm(op "l "__percpu_seg"%1,%0" \ asm(op "l "__percpu_seg"%1,%0" \
: "=r" (ret__) \ : "=r" (ret__) \
: "m" (var)); \ : "m" (var)); \
break; \ break; \
default: __bad_percpu_size(); \ default: __bad_percpu_size(); \
} \ } \
ret__; }) ret__; \
})
#define x86_read_percpu(var) percpu_from_op("mov", per_cpu__##var) #define x86_read_percpu(var) percpu_from_op("mov", per_cpu__##var)
#define x86_write_percpu(var,val) percpu_to_op("mov", per_cpu__##var, val) #define x86_write_percpu(var, val) percpu_to_op("mov", per_cpu__##var, val)
#define x86_add_percpu(var,val) percpu_to_op("add", per_cpu__##var, val) #define x86_add_percpu(var, val) percpu_to_op("add", per_cpu__##var, val)
#define x86_sub_percpu(var,val) percpu_to_op("sub", per_cpu__##var, val) #define x86_sub_percpu(var, val) percpu_to_op("sub", per_cpu__##var, val)
#define x86_or_percpu(var,val) percpu_to_op("or", per_cpu__##var, val) #define x86_or_percpu(var, val) percpu_to_op("or", per_cpu__##var, val)
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* !CONFIG_X86_64 */ #endif /* !CONFIG_X86_64 */
#endif /* _ASM_X86_PERCPU_H_ */ #endif /* _ASM_X86_PERCPU_H_ */