Commit 9efbcd590243045111670c171a951923b877b57d

Authored by Luca Barbieri
Committed by H. Peter Anvin
1 parent d7f6de1e9c

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>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -104,11 +104,11 @@
104 104 BUG_ON(v.counter != r);
105 105  
106 106 INIT(v0);
107   - BUG_ON(!atomic64_add_unless(&v, one, v0));
  107 + BUG_ON(atomic64_add_unless(&v, one, v0));
108 108 BUG_ON(v.counter != r);
109 109  
110 110 INIT(v0);
111   - BUG_ON(atomic64_add_unless(&v, one, v1));
  111 + BUG_ON(!atomic64_add_unless(&v, one, v1));
112 112 r += one;
113 113 BUG_ON(v.counter != r);
114 114