On Fri, Dec 13, 2013 at 03:56:59PM +0100, Peter Zijlstra wrote: > Move the barriers functions that depend on the atomic implementation > into the atomic implementation. > > Signed-off-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Reviewed-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx> > --- > arch/arc/include/asm/atomic.h | 5 +++++ > arch/arc/include/asm/barrier.h | 5 ----- > arch/hexagon/include/asm/atomic.h | 6 +++++- > arch/hexagon/include/asm/barrier.h | 4 ---- > 4 files changed, 10 insertions(+), 10 deletions(-) > > --- a/arch/arc/include/asm/atomic.h > +++ b/arch/arc/include/asm/atomic.h > @@ -190,6 +190,11 @@ static inline void atomic_clear_mask(uns > > #endif /* !CONFIG_ARC_HAS_LLSC */ > > +#define smp_mb__before_atomic_dec() barrier() > +#define smp_mb__after_atomic_dec() barrier() > +#define smp_mb__before_atomic_inc() barrier() > +#define smp_mb__after_atomic_inc() barrier() > + > /** > * __atomic_add_unless - add unless the number is a given value > * @v: pointer of type atomic_t > --- a/arch/arc/include/asm/barrier.h > +++ b/arch/arc/include/asm/barrier.h > @@ -30,11 +30,6 @@ > #define smp_wmb() barrier() > #endif > > -#define smp_mb__before_atomic_dec() barrier() > -#define smp_mb__after_atomic_dec() barrier() > -#define smp_mb__before_atomic_inc() barrier() > -#define smp_mb__after_atomic_inc() barrier() > - > #define smp_read_barrier_depends() do { } while (0) > > #endif > --- a/arch/hexagon/include/asm/atomic.h > +++ b/arch/hexagon/include/asm/atomic.h > @@ -160,8 +160,12 @@ static inline int __atomic_add_unless(at > #define atomic_sub_and_test(i, v) (atomic_sub_return(i, (v)) == 0) > #define atomic_add_negative(i, v) (atomic_add_return(i, (v)) < 0) > > - > #define atomic_inc_return(v) (atomic_add_return(1, v)) > #define atomic_dec_return(v) (atomic_sub_return(1, v)) > > +#define smp_mb__before_atomic_dec() barrier() > +#define smp_mb__after_atomic_dec() barrier() > +#define smp_mb__before_atomic_inc() barrier() > +#define smp_mb__after_atomic_inc() barrier() > + > #endif > --- a/arch/hexagon/include/asm/barrier.h > +++ b/arch/hexagon/include/asm/barrier.h > @@ -29,10 +29,6 @@ > #define smp_read_barrier_depends() barrier() > #define smp_wmb() barrier() > #define smp_mb() barrier() > -#define smp_mb__before_atomic_dec() barrier() > -#define smp_mb__after_atomic_dec() barrier() > -#define smp_mb__before_atomic_inc() barrier() > -#define smp_mb__after_atomic_inc() barrier() > > /* Set a value and use a memory barrier. Used by the scheduler somewhere. */ > #define set_mb(var, value) \ > > -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html