Re: [PATCH] atomic: generalize atomic_add_unless_return

From: Arun Sharma
Date: Mon Jun 06 2011 - 12:11:43 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/