Skip to content

Commit

Permalink
lib: Fix atomic64_add_unless test
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Luca Barbieri <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
luca-barbieri authored and H. Peter Anvin committed Mar 1, 2010
1 parent d7f6de1 commit 9efbcd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/atomic64_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 9efbcd5

Please sign in to comment.