summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2022-08-26 23:43:51 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-08-27 19:49:54 +0300
commitd6ffe6067a54972564552ea45d320fb98db1ac5e (patch)
treef5e9fe0bc2a8eaa1669802af515b91498ea806af /arch/sh
parente022620b5d056e822e42eb9bc0f24fcb97389d86 (diff)
downloadlinux-d6ffe6067a54972564552ea45d320fb98db1ac5e.tar.xz
provide arch_test_bit_acquire for architectures that define test_bit
Some architectures define their own arch_test_bit and they also need arch_test_bit_acquire, otherwise they won't compile. We also clean up the code by using the generic test_bit if that is equivalent to the arch-specific version. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Fixes: 8238b4579866 ("wait_on_bit: add an acquire memory barrier") Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/bitops-op32.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/sh/include/asm/bitops-op32.h b/arch/sh/include/asm/bitops-op32.h
index 565a85d8b7fb..5ace89b46507 100644
--- a/arch/sh/include/asm/bitops-op32.h
+++ b/arch/sh/include/asm/bitops-op32.h
@@ -135,16 +135,8 @@ arch___test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
return (old & mask) != 0;
}
-/**
- * arch_test_bit - Determine whether a bit is set
- * @nr: bit number to test
- * @addr: Address to start counting from
- */
-static __always_inline bool
-arch_test_bit(unsigned long nr, const volatile unsigned long *addr)
-{
- return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
-}
+#define arch_test_bit generic_test_bit
+#define arch_test_bit_acquire generic_test_bit_acquire
#include <asm-generic/bitops/non-instrumented-non-atomic.h>