[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTinEkfRH-xJRyrtajSLEkEwrau7yRA@mail.gmail.com>
Date: Sun, 5 Jun 2011 00:09:25 -0400
From: Mike Frysinger <vapier.adi@...il.com>
To: Arun Sharma <asharma@...com>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
David Miller <davem@...emloft.net>,
Andrew Morton <akpm@...l.org>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH] atomic: generalize atomic_add_unless_return
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists