diff mbox

[PATCH:drm,4/4] Fix libdrm's atomic_dec_and_test on Solaris.

Message ID 1405844794-27210-4-git-send-email-wiz@NetBSD.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Thomas Klausner July 20, 2014, 8:26 a.m. UTC
_nv means new value, not old value!

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
---
 xf86atomic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/xf86atomic.h b/xf86atomic.h
index d0f85fc..4e7691f 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -85,7 +85,7 @@  typedef struct { uint_t atomic; } atomic_t;
 # define atomic_read(x) (int) ((x)->atomic)
 # define atomic_set(x, val) ((x)->atomic = (uint_t)(val))
 # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
-# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1)
+# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
 # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
 # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
 # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)