From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754557Ab1G0K72 (ORCPT ); Wed, 27 Jul 2011 06:59:28 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:41814 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754492Ab1G0K7N (ORCPT ); Wed, 27 Jul 2011 06:59:13 -0400 Date: Wed, 27 Jul 2011 06:59:07 -0400 From: Neil Horman To: Sven Eckelmann 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 Message-ID: <20110727105907.GA19001@hmsreliant.think-freely.org> References: <1311760070-21532-1-git-send-email-sven@narfation.org> <1311760070-21532-10-git-send-email-sven@narfation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1311760070-21532-10-git-send-email-sven@narfation.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.2 (-) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote: > atomic_dec_not_zero is defined for each architecture through > to provide the functionality of > atomic_add_unless(x, -1, 0). > > Signed-off-by: Sven Eckelmann > Cc: Neil Horman > 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