Skip to content

Commit 3629335

Browse files
sean-jcbonzini
authored andcommitted
tools: Drop "atomic_" prefix from atomic test_and_set_bit()
Drop the "atomic_" prefix from tools' atomic_test_and_set_bit() to match the kernel nomenclature where test_and_set_bit() is atomic, and __test_and_set_bit() provides the non-atomic variant. Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7f32a6c commit 3629335

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

tools/arch/x86/include/asm/atomic.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ static __always_inline int atomic_cmpxchg(atomic_t *v, int old, int new)
7171
return cmpxchg(&v->counter, old, new);
7272
}
7373

74-
static inline int atomic_test_and_set_bit(long nr, unsigned long *addr)
74+
static inline int test_and_set_bit(long nr, unsigned long *addr)
7575
{
7676
GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(bts), *addr, "Ir", nr, "%0", "c");
77-
7877
}
7978

8079
#endif /* _TOOLS_LINUX_ASM_X86_ATOMIC_H */

tools/include/asm-generic/atomic-gcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int oldval, int newval)
7070
return cmpxchg(&(v)->counter, oldval, newval);
7171
}
7272

73-
static inline int atomic_test_and_set_bit(long nr, unsigned long *addr)
73+
static inline int test_and_set_bit(long nr, unsigned long *addr)
7474
{
7575
unsigned long mask = BIT_MASK(nr);
7676
long old;

tools/testing/selftests/kvm/lib/ucall_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static struct ucall *ucall_alloc(void)
4444
GUEST_ASSERT(ucall_pool);
4545

4646
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
47-
if (!atomic_test_and_set_bit(i, ucall_pool->in_use)) {
47+
if (!test_and_set_bit(i, ucall_pool->in_use)) {
4848
uc = &ucall_pool->ucalls[i];
4949
memset(uc->args, 0, sizeof(uc->args));
5050
return uc;

0 commit comments

Comments
 (0)