public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <asharma@fb.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.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: Mon, 06 Jun 2011 09:12:12 -0700	[thread overview]
Message-ID: <4DECFC5C.40603@fb.com> (raw)
In-Reply-To: <1307259315.20604.2.camel@edumazet-laptop>

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


      reply	other threads:[~2011-06-06 16:11 UTC|newest]

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

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=4DECFC5C.40603@fb.com \
    --to=asharma@fb.com \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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