[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/20] atomic.h: Reword confusing comment for qatomic_cmpxchg
From: |
Peter Maydell |
Subject: |
[PULL 19/20] atomic.h: Reword confusing comment for qatomic_cmpxchg |
Date: |
Tue, 5 Mar 2024 13:52:36 +0000 |
The qatomic_cmpxchg() and qatomic_cmpxchg__nocheck() macros have
a comment that reads:
Returns the eventual value, failed or not
This is somewhere between cryptic and wrong, since the value actually
returned is the value that was in memory before the cmpxchg. Reword
to match how we describe these macros in atomics.rst.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-id: 20240223182035.1048541-1-peter.maydell@linaro.org
---
include/qemu/atomic.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
index f1d3d1702a9..99110abefb3 100644
--- a/include/qemu/atomic.h
+++ b/include/qemu/atomic.h
@@ -202,7 +202,7 @@
qatomic_xchg__nocheck(ptr, i); \
})
-/* Returns the eventual value, failed or not */
+/* Returns the old value of '*ptr' (whether the cmpxchg failed or not) */
#define qatomic_cmpxchg__nocheck(ptr, old, new) ({ \
typeof_strip_qual(*ptr) _old = (old); \
(void)__atomic_compare_exchange_n(ptr, &_old, new, false, \
--
2.34.1
- [PULL 00/20] target-arm queue, Peter Maydell, 2024/03/05
- [PULL 03/20] tests/qtest: Add testcase for BCM2835 BSC, Peter Maydell, 2024/03/05
- [PULL 10/20] hw/misc/stm32l4x5_rcc: Add write protections to CR register, Peter Maydell, 2024/03/05
- [PULL 12/20] tests/qtest/stm32l4x5_rcc-test.c: Add tests for the STM32L4x5_RCC, Peter Maydell, 2024/03/05
- [PULL 06/20] hw/misc/stm32l4x5_rcc: Add an internal clock multiplexer object, Peter Maydell, 2024/03/05
- [PULL 17/20] target/arm: Do memory type alignment check when translation disabled, Peter Maydell, 2024/03/05
- [PULL 19/20] atomic.h: Reword confusing comment for qatomic_cmpxchg,
Peter Maydell <=
- [PULL 15/20] accel/tcg: Add tlb_fill_flags to CPUTLBEntryFull, Peter Maydell, 2024/03/05
- [PULL 08/20] hw/misc/stm32l4x5_rcc: Initialize PLLs and clock multiplexers, Peter Maydell, 2024/03/05
- [PULL 16/20] accel/tcg: Add TLB_CHECK_ALIGNED, Peter Maydell, 2024/03/05
- [PULL 07/20] hw/misc/stm32l4x5_rcc: Add an internal PLL Clock object, Peter Maydell, 2024/03/05
- [PULL 09/20] hw/misc/stm32l4x5_rcc: Handle Register Updates, Peter Maydell, 2024/03/05
- [PULL 02/20] hw/arm: Connect BSC to BCM2835 board as I2C0, I2C1 and I2C2, Peter Maydell, 2024/03/05
- [PULL 14/20] exec/memattrs: Remove target_tlb_bit*, Peter Maydell, 2024/03/05
- [PULL 20/20] qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports, Peter Maydell, 2024/03/05
- [PULL 01/20] hw/i2c: Implement Broadcom Serial Controller (BSC), Peter Maydell, 2024/03/05
- [PULL 11/20] hw/arm/stm32l4x5_soc.c: Use the RCC Sysclk, Peter Maydell, 2024/03/05