From: tip-bot for Luca Barbieri <luca@luca-barbieri.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
luca@luca-barbieri.com, tglx@linutronix.de
Subject: [tip:x86/atomic] lib: Only test atomic64_dec_if_positive on archs having it
Date: Mon, 1 Mar 2010 19:57:36 GMT [thread overview]
Message-ID: <tip-8f4f202b335144bf5be5c9e5b1bc9477ecdae958@git.kernel.org> (raw)
In-Reply-To: <1267183361-20775-1-git-send-email-luca@luca-barbieri.com>
Commit-ID: 8f4f202b335144bf5be5c9e5b1bc9477ecdae958
Gitweb: http://git.kernel.org/tip/8f4f202b335144bf5be5c9e5b1bc9477ecdae958
Author: Luca Barbieri <luca@luca-barbieri.com>
AuthorDate: Fri, 26 Feb 2010 12:22:40 +0100
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Mon, 1 Mar 2010 11:37:55 -0800
lib: Only test atomic64_dec_if_positive on archs having it
Currently atomic64_dec_if_positive() is only supported by PowerPC,
MIPS and x86-32.
Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
LKML-Reference: <1267183361-20775-1-git-send-email-luca@luca-barbieri.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
lib/atomic64_test.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c
index 4ff649e..0effcac 100644
--- a/lib/atomic64_test.c
+++ b/lib/atomic64_test.c
@@ -112,6 +112,7 @@ static __init int test_atomic64(void)
r += one;
BUG_ON(v.counter != r);
+#if defined(CONFIG_X86_32) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(_ASM_GENERIC_ATOMIC64_H)
INIT(onestwos);
BUG_ON(atomic64_dec_if_positive(&v) != (onestwos - 1));
r -= one;
@@ -124,6 +125,9 @@ static __init int test_atomic64(void)
INIT(-one);
BUG_ON(atomic64_dec_if_positive(&v) != (-one - one));
BUG_ON(v.counter != r);
+#else
+#warning Please implement atomic64_dec_if_positive for your architecture, and add it to the IF above
+#endif
INIT(onestwos);
BUG_ON(atomic64_inc_not_zero(&v));
prev parent reply other threads:[~2010-03-01 19:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 11:22 [PATCH 1/2] lib: only " Luca Barbieri
2010-02-26 11:22 ` [PATCH 2/2] x86: implement atomic[64]_dec_if_positive Luca Barbieri
2010-03-01 19:57 ` [tip:x86/atomic] x86: Implement atomic[64]_dec_if_positive() tip-bot for Luca Barbieri
2010-03-01 19:57 ` tip-bot for Luca Barbieri [this message]
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=tip-8f4f202b335144bf5be5c9e5b1bc9477ecdae958@git.kernel.org \
--to=luca@luca-barbieri.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome