Skip to content

Commit

Permalink
riscv: fix test_and_{set,clear}_bit ordering documentation
Browse files Browse the repository at this point in the history
test_and_{set,clear}_bit are fully ordered as specified in
Documentation/atomic_bitops.txt. Fix incorrect comment stating otherwise.

Note that the implementation is correct since commit
9347ce5 ("RISC-V: __test_and_op_bit_ord should be strongly ordered")
was introduced.

Signed-off-by: Ignacio Encinas <ignacio@iencinas.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
  • Loading branch information
Ignacio Encinas authored and Yury Norov committed Mar 12, 2025
1 parent 0312e94 commit e3f42c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/riscv/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static __always_inline int variable_fls(unsigned int x)
* @nr: Bit to set
* @addr: Address to count from
*
* This operation may be reordered on other architectures than x86.
* This is an atomic fully-ordered operation (implied full memory barrier).
*/
static __always_inline int arch_test_and_set_bit(int nr, volatile unsigned long *addr)
{
Expand All @@ -238,7 +238,7 @@ static __always_inline int arch_test_and_set_bit(int nr, volatile unsigned long
* @nr: Bit to clear
* @addr: Address to count from
*
* This operation can be reordered on other architectures other than x86.
* This is an atomic fully-ordered operation (implied full memory barrier).
*/
static __always_inline int arch_test_and_clear_bit(int nr, volatile unsigned long *addr)
{
Expand Down

0 comments on commit e3f42c4

Please sign in to comment.