Re: [PATCH] atomic.h: Reword confusing comment for qatomic_cmpxchg

2024-02-26 Thread Zhao Liu
On Fri, Feb 23, 2024 at 06:20:35PM +, Peter Maydell wrote: > Date: Fri, 23 Feb 2024 18:20:35 + > From: Peter Maydell > Subject: [PATCH] atomic.h: Reword confusing comment for qatomic_cmpxchg > X-Mailer: git-send-email 2.34.1 > > The qatomic_cmpxchg() and qatomic_cmpxchg

Re: [PATCH] atomic.h: Reword confusing comment for qatomic_cmpxchg

2024-02-23 Thread Jonathan Cameron via
On Fri, 23 Feb 2024 08:21:42 -1000 Richard Henderson wrote: > On 2/23/24 08:20, Peter Maydell wrote: > > 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,

Re: [PATCH] atomic.h: Reword confusing comment for qatomic_cmpxchg

2024-02-23 Thread Richard Henderson
On 2/23/24 08:20, Peter Maydell wrote: 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 cmpx

[PATCH] atomic.h: Reword confusing comment for qatomic_cmpxchg

2024-02-23 Thread Peter Maydell
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 thes