Skip to content

Commit 7f32a6c

Browse files
sean-jcbonzini
authored andcommitted
tools: Drop conflicting non-atomic test_and_{clear,set}_bit() helpers
Drop tools' non-atomic test_and_set_bit() and test_and_clear_bit() helpers now that all users are gone. The names will be claimed in the future for atomic versions. Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 03a0c81 commit 7f32a6c

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

tools/include/linux/bitmap.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -77,40 +77,6 @@ static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
7777
__bitmap_or(dst, src1, src2, nbits);
7878
}
7979

80-
/**
81-
* test_and_set_bit - Set a bit and return its old value
82-
* @nr: Bit to set
83-
* @addr: Address to count from
84-
*/
85-
static inline int test_and_set_bit(int nr, unsigned long *addr)
86-
{
87-
unsigned long mask = BIT_MASK(nr);
88-
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
89-
unsigned long old;
90-
91-
old = *p;
92-
*p = old | mask;
93-
94-
return (old & mask) != 0;
95-
}
96-
97-
/**
98-
* test_and_clear_bit - Clear a bit and return its old value
99-
* @nr: Bit to clear
100-
* @addr: Address to count from
101-
*/
102-
static inline int test_and_clear_bit(int nr, unsigned long *addr)
103-
{
104-
unsigned long mask = BIT_MASK(nr);
105-
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
106-
unsigned long old;
107-
108-
old = *p;
109-
*p = old & ~mask;
110-
111-
return (old & mask) != 0;
112-
}
113-
11480
/**
11581
* bitmap_zalloc - Allocate bitmap
11682
* @nbits: Number of bits

0 commit comments

Comments
 (0)