Netdev List
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Sven Eckelmann <sven@narfation.org>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless
Date: Wed, 27 Jul 2011 06:59:07 -0400	[thread overview]
Message-ID: <20110727105907.GA19001@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1311760070-21532-10-git-send-email-sven@narfation.org>

On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote:
> atomic_dec_not_zero is defined for each architecture through
> <linux/atomic.h> to provide the functionality of
> atomic_add_unless(x, -1, 0).
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: netdev@vger.kernel.org
> ---
>  net/core/drop_monitor.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 7f36b38..ef4a05d 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
>  	struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
>  
>  
> -	if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> +	if (!atomic_dec_not_zero(&data->dm_hit_count)) {
>  		/*
>  		 * we're already at zero, discard this hit
>  		 */
> -- 
> 1.7.5.4
> 
> 
Wheres the patch that creates the per arch definition of this function?  I see
the other posts in this series went to lkml, but the archives don't have the
first in the series anywhere, which ostensibly adds the definition.  
Neil


  reply	other threads:[~2011-07-27 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
2011-07-27  9:47 ` [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann
2011-07-27 10:59   ` Neil Horman [this message]
2011-07-27 11:52     ` Sven Eckelmann
2011-07-27 14:25       ` Neil Horman

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=20110727105907.GA19001@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.org \
    /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