From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754358Ab1G0K3m (ORCPT ); Wed, 27 Jul 2011 06:29:42 -0400 Received: from smtp.nokia.com ([147.243.1.47]:46369 "EHLO mgw-sa01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867Ab1G0K3l convert rfc822-to-8bit (ORCPT ); Wed, 27 Jul 2011 06:29:41 -0400 From: "=?iso-8859-15?q?R=E9mi?= Denis-Courmont" Organization: MeeGo Devices - Nokia To: linux-arch@vger.kernel.org Subject: Re: [PATCHv4 11/11] Phonet: Use *_dec_not_zero instead of *_add_unless Date: Wed, 27 Jul 2011 13:29:43 +0300 User-Agent: KMail/1.13.6 (Linux/2.6.38-10-generic; KDE/4.6.2; i686; ; ) Cc: linux-kernel@vger.kernel.org References: <1311760070-21532-1-git-send-email-sven@narfation.org> <1311760070-21532-11-git-send-email-sven@narfation.org> In-Reply-To: <1311760070-21532-11-git-send-email-sven@narfation.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 8BIT Message-Id: <201107271329.44069.remi.denis-courmont@nokia.com> X-Nokia-AV: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 27 July 2011 12:47:50 ext Sven Eckelmann, you 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: Remi Denis-Courmont Acked-by: Rémi Denis-Courmont > --- > net/phonet/pep.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/net/phonet/pep.c b/net/phonet/pep.c > index f17fd84..b192c83 100644 > --- a/net/phonet/pep.c > +++ b/net/phonet/pep.c > @@ -1013,7 +1013,7 @@ static int pipe_skb_send(struct sock *sk, struct > sk_buff *skb) int err; > > if (pn_flow_safe(pn->tx_fc) && > - !atomic_add_unless(&pn->tx_credits, -1, 0)) { > + !atomic_dec_not_zero(&pn->tx_credits)) { > kfree_skb(skb); > return -ENOBUFS; > } -- Rémi Denis-Courmont http://www.remlab.net/