mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: Arun Sharma <asharma@fb.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	David Miller <davem@davemloft.net>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] atomic: generalize atomic_add_unless_return
Date: Sun, 05 Jun 2011 09:35:15 +0200	[thread overview]
Message-ID: <1307259315.20604.2.camel@edumazet-laptop> (raw)
In-Reply-To: <BANLkTinEkfRH-xJRyrtajSLEkEwrau7yRA@mail.gmail.com>

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 ;)




  reply	other threads:[~2011-06-05  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  0:57 Arun Sharma
2011-06-05  4:09 ` Mike Frysinger
2011-06-05  7:35   ` Eric Dumazet [this message]
2011-06-06 16:12     ` Arun Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307259315.20604.2.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=akpm@osdl.org \
    --cc=asharma@fb.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®