Skip to content

Commit

Permalink
lib: Fix atomic64_inc_not_zero test
Browse files Browse the repository at this point in the history
atomic64_inc_not_zero must return 1 if it perfomed the add and 0 otherwise.
The test assumed the opposite convention.

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 9757789 commit 25a304f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/atomic64_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ static __init int test_atomic64(void)
#endif

INIT(onestwos);
BUG_ON(atomic64_inc_not_zero(&v));
BUG_ON(!atomic64_inc_not_zero(&v));
r += one;
BUG_ON(v.counter != r);

INIT(0);
BUG_ON(!atomic64_inc_not_zero(&v));
BUG_ON(atomic64_inc_not_zero(&v));
BUG_ON(v.counter != r);

INIT(-one);
BUG_ON(atomic64_inc_not_zero(&v));
BUG_ON(!atomic64_inc_not_zero(&v));
r += one;
BUG_ON(v.counter != r);

Expand Down

0 comments on commit 25a304f

Please sign in to comment.