public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@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	[thread overview]
Message-ID: <201107271329.44069.remi.denis-courmont@nokia.com> (raw)
In-Reply-To: <1311760070-21532-11-git-send-email-sven@narfation.org>

On Wednesday 27 July 2011 12:47:50 ext Sven Eckelmann, you 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: Remi Denis-Courmont <remi.denis-courmont@nokia.com>

Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

> ---
>  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/

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

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27  9:47 [PATCHv4 01/11] atomic: add *_dec_not_zero Sven Eckelmann
     [not found] ` <1311760070-21532-1-git-send-email-sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
2011-07-27  9:47   ` [PATCHv4 02/11] batman-adv: Remove private define of atomic_dec_not_zero Sven Eckelmann
2011-07-27  9:47     ` Sven Eckelmann
2011-07-27  9:47 ` [PATCHv4 03/11] fault_inject: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27  9:47 ` [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann
2011-07-27 19:50   ` Rafael J. Wysocki
2011-07-27 20:36     ` Pavel Machek
2011-07-27 20:36       ` Pavel Machek
2011-07-28 21:43       ` Rafael J. Wysocki
2011-07-28 21:43         ` Rafael J. Wysocki
2011-07-27  9:47 ` [PATCHv4 05/11] omap3isp: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-31 15:00   ` Laurent Pinchart
2011-08-01 10:07     ` Sven Eckelmann
2011-08-01 11:10       ` Laurent Pinchart
2011-08-01 11:10         ` Laurent Pinchart
2011-07-27  9:47 ` [PATCHv4 06/11] qeth: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27  9:47 ` [PATCHv4 07/11] ext4: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27  9:47 ` [PATCHv4 08/11] xfs: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27  9:47 ` [PATCHv4 09/11] memcg: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27 11:58   ` Michal Hocko
2011-07-27  9:47 ` [PATCHv4 10/11] drop_monitor: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27 10:59   ` Neil Horman
2011-07-27 10:59     ` Neil Horman
2011-07-27 11:52     ` Sven Eckelmann
2011-07-27 14:25       ` Neil Horman
2011-07-27 14:25         ` Neil Horman
2011-07-27  9:47 ` [PATCHv4 11/11] Phonet: " Sven Eckelmann
2011-07-27  9:47   ` Sven Eckelmann
2011-07-27 10:29   ` Rémi Denis-Courmont [this message]
2011-08-02  9:58 ` [PATCHv4 01/11] atomic: add *_dec_not_zero Ralf Baechle

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=201107271329.44069.remi.denis-courmont@nokia.com \
    --to=remi.denis-courmont@nokia.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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