Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de9e432c authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner
Browse files

atomic: Collapse all atomic_{set,clear}_mask definitions



Move the now generic definitions of atomic_{set,clear}_mask() into
linux/atomic.h to avoid endless and pointless repetition.

Also, provide an atomic_andnot() wrapper for those few archs that can
implement that.

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent e6942b7d
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -155,16 +155,6 @@ ATOMIC_OP(xor, ^=, xor)
#undef ATOMIC_OP_RETURN
#undef ATOMIC_OP

static inline __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
	atomic_and(~mask, v);
}

static inline __deprecated void atomic_set_mask(unsigned int mask, atomic_t *v)
{
	atomic_or(mask, v);
}

/**
 * __atomic_add_unless - add unless the number is a given value
 * @v: pointer of type atomic_t
+0 −10
Original line number Diff line number Diff line
@@ -32,16 +32,6 @@ asmlinkage int __raw_atomic_test_asm(const volatile int *ptr, int value);
#define atomic_and(i, v) (void)__raw_atomic_and_asm(&(v)->counter, i)
#define atomic_xor(i, v) (void)__raw_atomic_xor_asm(&(v)->counter, i)

static inline __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
	atomic_and(~mask, v);
}

static inline __deprecated void atomic_set_mask(unsigned int mask, atomic_t *v)
{
	atomic_or(mask, v);
}

#endif

#include <asm-generic/atomic.h>
+0 −10
Original line number Diff line number Diff line
@@ -198,14 +198,4 @@ ATOMIC_OP(xor)

#undef ATOMIC_OP

static inline __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
	atomic_and(~mask, v);
}

static inline __deprecated void atomic_set_mask(unsigned int mask, atomic_t *v)
{
	atomic_or(mask, v);
}

#endif /* _ASM_ATOMIC_H */
+0 −10
Original line number Diff line number Diff line
@@ -89,14 +89,4 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
	return ret;
}

static inline __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
	atomic_and(~mask, v);
}

static inline __deprecated void atomic_set_mask(unsigned int mask, atomic_t *v)
{
	atomic_or(mask, v);
}

#endif /* __ARCH_H8300_ATOMIC __ */
+0 −11
Original line number Diff line number Diff line
@@ -243,15 +243,4 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
	return c;
}


static __inline__ __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
	atomic_and(~mask, v);
}

static __inline__ __deprecated void atomic_set_mask(unsigned int mask, atomic_t *v)
{
	atomic_or(mask, v);
}

#endif	/* _ASM_M32R_ATOMIC_H */
Loading