Messages in this thread | | | Date | Mon, 06 Jun 2011 09:12:12 -0700 | From | Arun Sharma <> | Subject | Re: [PATCH] atomic: generalize atomic_add_unless_return |
| |
On 6/5/11 12:35 AM, Eric Dumazet wrote:
>>> + * Returns the old value of @v + @a. >>> + */ >>> +static inline int atomic_add_unless_return(atomic_t *v, int a, int u) >> [...] >> >> also, the semantics here appear to deviate from the other atomic >> funcs. the existing xxx_return funcs return the new result, not the >> old. >> -mike > > Arun comment is wrong, this function does return the new value of the > atomic_t after our operation, not the old ;)
The comment is technically correct:
old value of @v + @a = new value of @v.
I'll try to make it less confusing :)
Mike: Thanks for the review. I'll fix up the commit log and the func name and post a new patch.
-Arun
| |