From: Matt Turner <mattst88@gmail.com>
To: Sven Eckelmann <sven@narfation.org>
Cc: linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
Chris Metcalf <cmetcalf@tilera.com>,
x86@kernel.org, linux-alpha@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
uclinux-dist-devel@blackfin.uclinux.org,
linux-cris-kernel@axis.com, linux-ia64@vger.kernel.org,
linux-m32r@ml.linux-m32r.org, linux-m68k@lists.linux-m68k.org,
linux-mips@linux-mips.org, linux-am33-list@redhat.com,
linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
sparclinux@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH] atomic: add *_dec_not_zero
Date: Wed, 4 May 2011 14:13:29 -0400 [thread overview]
Message-ID: <BANLkTinWa9E1_iLWyqAF+G8Qag=YK2T98A@mail.gmail.com> (raw)
In-Reply-To: <1304458235-28473-1-git-send-email-sven@narfation.org>
On Tue, May 3, 2011 at 5:30 PM, Sven Eckelmann <sven@narfation.org> wrote:
> diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
> index e756d04..7e9434e 100644
> --- a/arch/alpha/include/asm/atomic.h
> +++ b/arch/alpha/include/asm/atomic.h
> @@ -200,6 +200,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
> }
>
> #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
> +#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
>
> /**
> * atomic64_add_unless - add unless the number is a given value
> @@ -226,6 +227,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
> }
>
> #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
> +#define atomic64_dec_not_zero(v) atomic64_add_unless((v), -1, 0)
>
> #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
> #define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
> diff --git a/arch/alpha/include/asm/local.h b/arch/alpha/include/asm/local.h
> index b9e3e33..09fb327 100644
> --- a/arch/alpha/include/asm/local.h
> +++ b/arch/alpha/include/asm/local.h
> @@ -79,6 +79,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
> c != (u); \
> })
> #define local_inc_not_zero(l) local_add_unless((l), 1, 0)
> +#define local_dec_not_zero(l) local_add_unless((l), -1, 0)
>
> #define local_add_negative(a, l) (local_add_return((a), (l)) < 0)
>
Acked-by: Matt Turner <mattst88@gmail.com> [alpha]
next prev parent reply other threads:[~2011-05-04 18:13 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 21:30 [PATCH] atomic: add *_dec_not_zero Sven Eckelmann
2011-05-03 21:30 ` Sven Eckelmann
2011-05-04 4:44 ` Mike Frysinger
2011-05-04 4:44 ` Mike Frysinger
2011-05-04 15:04 ` James Bottomley
2011-05-04 15:04 ` James Bottomley
2011-05-04 6:12 ` David Miller
2011-05-04 6:12 ` David Miller
2011-05-04 7:03 ` Ingo Molnar
2011-05-04 7:03 ` Ingo Molnar
2011-05-04 8:05 ` David Laight
2011-05-04 8:05 ` David Laight
2011-05-04 8:21 ` Sven Eckelmann
2011-05-04 8:21 ` Sven Eckelmann
2011-05-04 8:33 ` Mike Frysinger
[not found] ` <1304458235-28473-1-git-send-email-sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
2011-05-04 10:48 ` Jesper Nilsson
2011-05-04 11:02 ` Ralf Baechle
2011-05-04 11:02 ` Ralf Baechle
2011-05-04 11:53 ` David Howells
2011-05-04 11:53 ` David Howells
2011-05-08 22:15 ` Benjamin Herrenschmidt
2011-05-08 22:15 ` Benjamin Herrenschmidt
2011-05-04 12:09 ` Chris Metcalf
2011-05-04 12:09 ` Chris Metcalf
2011-05-04 12:17 ` Geert Uytterhoeven
2011-05-04 12:17 ` Geert Uytterhoeven
2011-05-04 17:27 ` Will Deacon
2011-05-04 17:27 ` Will Deacon
2011-05-04 18:13 ` Matt Turner [this message]
2011-05-08 9:24 ` Russell King - ARM Linux
2011-05-08 9:24 ` Russell King - ARM Linux
2011-05-08 9:33 ` Sven Eckelmann
2011-05-08 9:33 ` Sven Eckelmann
2011-05-09 2:38 ` Mike Frysinger
2011-05-09 2:38 ` Mike Frysinger
2011-05-18 19:49 ` [PATCHv2] " Sven Eckelmann
2011-05-23 7:13 ` Paul Mundt
2011-05-23 7:13 ` Paul Mundt
2011-05-23 7:27 ` Heiko Carstens
2011-05-29 7:13 ` [PATCHv3] " Sven Eckelmann
2011-05-29 7:13 ` Sven Eckelmann
2011-06-02 5:44 ` Hirokazu Takata
2011-06-02 5:44 ` Hirokazu Takata
2011-06-17 10:38 ` [PATCHv3-resend] " Sven Eckelmann
2011-06-17 10:38 ` Sven Eckelmann
2011-06-17 15:13 ` Arnd Bergmann
2011-06-17 17:32 ` Sven Eckelmann
2011-06-17 17:32 ` Sven Eckelmann
2011-06-17 21:20 ` Arnd Bergmann
2011-06-17 21:20 ` Arnd Bergmann
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='BANLkTinWa9E1_iLWyqAF+G8Qag=YK2T98A@mail.gmail.com' \
--to=mattst88@gmail.com \
--cc=cmetcalf@tilera.com \
--cc=dhowells@redhat.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-am33-list@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-cris-kernel@axis.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m32r@ml.linux-m32r.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sparclinux@vger.kernel.org \
--cc=sven@narfation.org \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).