[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1307259315.20604.2.camel@edumazet-laptop>
Date: Sun, 05 Jun 2011 09:35:15 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Mike Frysinger <vapier.adi@...il.com>
Cc: Arun Sharma <asharma@...com>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
David Miller <davem@...emloft.net>,
Andrew Morton <akpm@...l.org>
Subject: Re: [PATCH] atomic: generalize atomic_add_unless_return
Le dimanche 05 juin 2011 à 00:09 -0400, Mike Frysinger a écrit :
> On Tue, May 31, 2011 at 20:57, Arun Sharma wrote:
> > --- 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
Arun comment is wrong, this function does return the new value of the
atomic_t after our operation, not the old ;)
--
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