aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-03-01 13:55:45 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-03-01 14:38:46 -0500
commit9efbcd590243045111670c171a951923b877b57d (patch)
treecc4d78f201cd40421a49715ce6cac4ae07f13fc3
parentd7f6de1e9c4a12e11ba7186c70f0f40caa76f590 (diff)
lib: Fix atomic64_add_unless test
atomic64_add_unless must return 1 if it perfomed the add and 0 otherwise. The test assumed the opposite convention. Reported-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267469749-11878-2-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--lib/atomic64_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c
index 58efdabb3845..ee8e6de8b413 100644
--- a/lib/atomic64_test.c
+++ b/lib/atomic64_test.c
@@ -104,11 +104,11 @@ static __init int test_atomic64(void)
104 BUG_ON(v.counter != r); 104 BUG_ON(v.counter != r);
105 105
106 INIT(v0); 106 INIT(v0);
107 BUG_ON(!atomic64_add_unless(&v, one, v0)); 107 BUG_ON(atomic64_add_unless(&v, one, v0));
108 BUG_ON(v.counter != r); 108 BUG_ON(v.counter != r);
109 109
110 INIT(v0); 110 INIT(v0);
111 BUG_ON(atomic64_add_unless(&v, one, v1)); 111 BUG_ON(!atomic64_add_unless(&v, one, v1));
112 r += one; 112 r += one;
113 BUG_ON(v.counter != r); 113 BUG_ON(v.counter != r);
114 114