Re: [PATCH] atomic: generalize atomic_add_unless_return
From: Mike Frysinger
Date: Sun Jun 05 2011 - 00:11:59 EST
On Tue, May 31, 2011 at 20:57, Arun Sharma wrote:
> commit 686a7e3 added this primitive to get something going
> for the stable branch.
>
> Move the primitive to <linux/atomic.h>
this changelog is confusing. please replace the pronouns with proper nouns.
> --- a/include/linux/atomic.h
> +++ b/include/linux/atomic.h
> Â/**
> + * atomic_add_unless - add unless the number is already a given value
> + * @v: pointer of type atomic_t
> + * @a: the amount to add to v...
> + * @u: ...unless v is equal to u.
> + *
> + * Atomically adds @a to @v, so long as @v was not already @u.
> + * Returns the old value of @v + @a.
> + */
> +static inline int atomic_add_unless_return(atomic_t *v, int a, int u)
the name of the func in the comment does not match the actual name of the func
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
--
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/