Skip to content

Commit e3f42c4

Browse files
IEncinas10YuryNorov
authored andcommitted
riscv: fix test_and_{set,clear}_bit ordering documentation
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>
1 parent 0312e94 commit e3f42c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/include/asm/bitops.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static __always_inline int variable_fls(unsigned int x)
226226
* @nr: Bit to set
227227
* @addr: Address to count from
228228
*
229-
* This operation may be reordered on other architectures than x86.
229+
* This is an atomic fully-ordered operation (implied full memory barrier).
230230
*/
231231
static __always_inline int arch_test_and_set_bit(int nr, volatile unsigned long *addr)
232232
{
@@ -238,7 +238,7 @@ static __always_inline int arch_test_and_set_bit(int nr, volatile unsigned long
238238
* @nr: Bit to clear
239239
* @addr: Address to count from
240240
*
241-
* This operation can be reordered on other architectures other than x86.
241+
* This is an atomic fully-ordered operation (implied full memory barrier).
242242
*/
243243
static __always_inline int arch_test_and_clear_bit(int nr, volatile unsigned long *addr)
244244
{

0 commit comments

Comments
 (0)