Merge branch 'for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 06:17:16 +0000 (15:17 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 06:17:16 +0000 (15:17 +0900)
Pull percpu changes from Tejun Heo:
 "Two smallish changes for percpu.  Two patches to remove unused
  this_cpu_xor() and one to fix a bug in percpu init failure path so
  that it can reach the proper BUG() instead of oopsing earlier"

* 'for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  x86: remove this_cpu_xor() implementation
  percpu: remove this_cpu_xor() implementation
  percpu: fix bootmem error handling in pcpu_page_first_chunk()

1  2 
arch/x86/include/asm/percpu.h
include/linux/percpu.h

index b3e18f800302ffee529e9aa99a22623118600042,604e13dc353daa3ff1fe97c84b1ae62698e1a96d..94220d14d5cc8644dddee1de861dd12b0c5a0ceb
@@@ -128,8 -128,7 +128,8 @@@ do {                                                       
  do {                                                                  \
        typedef typeof(var) pao_T__;                                    \
        const int pao_ID__ = (__builtin_constant_p(val) &&              \
 -                            ((val) == 1 || (val) == -1)) ? (val) : 0; \
 +                            ((val) == 1 || (val) == -1)) ?            \
 +                              (int)(val) : 0;                         \
        if (0) {                                                        \
                pao_T__ pao_tmp__;                                      \
                pao_tmp__ = (val);                                      \
  #define __this_cpu_or_1(pcp, val)     percpu_to_op("or", (pcp), val)
  #define __this_cpu_or_2(pcp, val)     percpu_to_op("or", (pcp), val)
  #define __this_cpu_or_4(pcp, val)     percpu_to_op("or", (pcp), val)
- #define __this_cpu_xor_1(pcp, val)    percpu_to_op("xor", (pcp), val)
- #define __this_cpu_xor_2(pcp, val)    percpu_to_op("xor", (pcp), val)
- #define __this_cpu_xor_4(pcp, val)    percpu_to_op("xor", (pcp), val)
  #define __this_cpu_xchg_1(pcp, val)   percpu_xchg_op(pcp, val)
  #define __this_cpu_xchg_2(pcp, val)   percpu_xchg_op(pcp, val)
  #define __this_cpu_xchg_4(pcp, val)   percpu_xchg_op(pcp, val)
  #define this_cpu_or_1(pcp, val)               percpu_to_op("or", (pcp), val)
  #define this_cpu_or_2(pcp, val)               percpu_to_op("or", (pcp), val)
  #define this_cpu_or_4(pcp, val)               percpu_to_op("or", (pcp), val)
- #define this_cpu_xor_1(pcp, val)      percpu_to_op("xor", (pcp), val)
- #define this_cpu_xor_2(pcp, val)      percpu_to_op("xor", (pcp), val)
- #define this_cpu_xor_4(pcp, val)      percpu_to_op("xor", (pcp), val)
  #define this_cpu_xchg_1(pcp, nval)    percpu_xchg_op(pcp, nval)
  #define this_cpu_xchg_2(pcp, nval)    percpu_xchg_op(pcp, nval)
  #define this_cpu_xchg_4(pcp, nval)    percpu_xchg_op(pcp, nval)
  #define __this_cpu_add_8(pcp, val)    percpu_add_op((pcp), val)
  #define __this_cpu_and_8(pcp, val)    percpu_to_op("and", (pcp), val)
  #define __this_cpu_or_8(pcp, val)     percpu_to_op("or", (pcp), val)
- #define __this_cpu_xor_8(pcp, val)    percpu_to_op("xor", (pcp), val)
  #define __this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val)
  #define __this_cpu_xchg_8(pcp, nval)  percpu_xchg_op(pcp, nval)
  #define __this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
  #define this_cpu_add_8(pcp, val)      percpu_add_op((pcp), val)
  #define this_cpu_and_8(pcp, val)      percpu_to_op("and", (pcp), val)
  #define this_cpu_or_8(pcp, val)               percpu_to_op("or", (pcp), val)
- #define this_cpu_xor_8(pcp, val)      percpu_to_op("xor", (pcp), val)
  #define this_cpu_add_return_8(pcp, val)       percpu_add_return_op(pcp, val)
  #define this_cpu_xchg_8(pcp, nval)    percpu_xchg_op(pcp, nval)
  #define this_cpu_cmpxchg_8(pcp, oval, nval)   percpu_cmpxchg_op(pcp, oval, nval)
diff --combined include/linux/percpu.h
index c74088ab103b2aeb3e13497af1cd09db4f6f18fb,fd6ffe459aaeaeaea09d56084710b344b721f03f..9e4761caa80c6ec906d2c0edad62cfbd2d4ab3bd
@@@ -332,7 -332,7 +332,7 @@@ do {                                                                       
  #endif
  
  #ifndef this_cpu_sub
 -# define this_cpu_sub(pcp, val)               this_cpu_add((pcp), -(val))
 +# define this_cpu_sub(pcp, val)               this_cpu_add((pcp), -(typeof(pcp))(val))
  #endif
  
  #ifndef this_cpu_inc
  # define this_cpu_or(pcp, val)                __pcpu_size_call(this_cpu_or_, (pcp), (val))
  #endif
  
- #ifndef this_cpu_xor
- # ifndef this_cpu_xor_1
- #  define this_cpu_xor_1(pcp, val)    _this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # ifndef this_cpu_xor_2
- #  define this_cpu_xor_2(pcp, val)    _this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # ifndef this_cpu_xor_4
- #  define this_cpu_xor_4(pcp, val)    _this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # ifndef this_cpu_xor_8
- #  define this_cpu_xor_8(pcp, val)    _this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # define this_cpu_xor(pcp, val)               __pcpu_size_call(this_cpu_or_, (pcp), (val))
- #endif
  #define _this_cpu_generic_add_return(pcp, val)                                \
  ({                                                                    \
        typeof(pcp) ret__;                                              \
  # define this_cpu_add_return(pcp, val)        __pcpu_size_call_return2(this_cpu_add_return_, pcp, val)
  #endif
  
 -#define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val))
 +#define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(typeof(pcp))(val))
  #define this_cpu_inc_return(pcp)      this_cpu_add_return(pcp, 1)
  #define this_cpu_dec_return(pcp)      this_cpu_add_return(pcp, -1)
  
@@@ -586,7 -570,7 +570,7 @@@ do {                                                                       
  #endif
  
  #ifndef __this_cpu_sub
 -# define __this_cpu_sub(pcp, val)     __this_cpu_add((pcp), -(val))
 +# define __this_cpu_sub(pcp, val)     __this_cpu_add((pcp), -(typeof(pcp))(val))
  #endif
  
  #ifndef __this_cpu_inc
  # define __this_cpu_or(pcp, val)      __pcpu_size_call(__this_cpu_or_, (pcp), (val))
  #endif
  
- #ifndef __this_cpu_xor
- # ifndef __this_cpu_xor_1
- #  define __this_cpu_xor_1(pcp, val)  __this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # ifndef __this_cpu_xor_2
- #  define __this_cpu_xor_2(pcp, val)  __this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # ifndef __this_cpu_xor_4
- #  define __this_cpu_xor_4(pcp, val)  __this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # ifndef __this_cpu_xor_8
- #  define __this_cpu_xor_8(pcp, val)  __this_cpu_generic_to_op((pcp), (val), ^=)
- # endif
- # define __this_cpu_xor(pcp, val)     __pcpu_size_call(__this_cpu_xor_, (pcp), (val))
- #endif
  #define __this_cpu_generic_add_return(pcp, val)                               \
  ({                                                                    \
        __this_cpu_add(pcp, val);                                       \
        __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val)
  #endif
  
 -#define __this_cpu_sub_return(pcp, val)       __this_cpu_add_return(pcp, -(val))
 +#define __this_cpu_sub_return(pcp, val)       __this_cpu_add_return(pcp, -(typeof(pcp))(val))
  #define __this_cpu_inc_return(pcp)    __this_cpu_add_return(pcp, 1)
  #define __this_cpu_dec_return(pcp)    __this_cpu_add_return(pcp, -1)