mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luca Barbieri <luca@luca-barbieri.com>
To: hpa@zytor.com
Cc: mingo@elte.hu, a.p.zijlstra@chello.nl, paulus@samba.org,
	linux-kernel@vger.kernel.org,
	Luca Barbieri <luca@luca-barbieri.com>
Subject: [PATCH 1/3] lib: fix atomic64_add_unless test
Date: Mon,  1 Mar 2010 18:14:58 +0100	[thread overview]
Message-ID: <1267463700-25524-2-git-send-email-luca@luca-barbieri.com> (raw)
In-Reply-To: <1267463700-25524-1-git-send-email-luca@luca-barbieri.com>

Was buggy as it replicated the bug in lib/atomic64.c

Reported-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
---
 lib/atomic64_test.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c
index 58efdab..ee8e6de 100644
--- a/lib/atomic64_test.c
+++ b/lib/atomic64_test.c
@@ -104,11 +104,11 @@ static __init int test_atomic64(void)
 	BUG_ON(v.counter != r);
 
 	INIT(v0);
-	BUG_ON(!atomic64_add_unless(&v, one, v0));
+	BUG_ON(atomic64_add_unless(&v, one, v0));
 	BUG_ON(v.counter != r);
 
 	INIT(v0);
-	BUG_ON(atomic64_add_unless(&v, one, v1));
+	BUG_ON(!atomic64_add_unless(&v, one, v1));
 	r += one;
 	BUG_ON(v.counter != r);
 
-- 
1.6.6.1.476.g01ddb


  reply	other threads:[~2010-03-01 17:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 17:14 [PATCH 0/3] Fix atomic64_add_unless return value convention Luca Barbieri
2010-03-01 17:14 ` Luca Barbieri [this message]
2010-03-01 17:14 ` [PATCH 2/3] x86: fix " Luca Barbieri
2010-03-01 17:15 ` [PATCH 3/3] lib: " Luca Barbieri
2010-03-01 21:26   ` Paul Mackerras
2010-03-01 18:25 ` [PATCH 0/3] Fix " H. Peter Anvin
2010-03-01 18:57   ` Luca Barbieri

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=1267463700-25524-2-git-send-email-luca@luca-barbieri.com \
    --to=luca@luca-barbieri.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®