[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201107271329.44069.remi.denis-courmont@nokia.com>
Date: Wed, 27 Jul 2011 13:29:43 +0300
From: "Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
To: linux-arch@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4 11/11] Phonet: Use *_dec_not_zero instead of *_add_unless
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@...fation.org>
> Cc: Remi Denis-Courmont <remi.denis-courmont@...ia.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@...ia.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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists