Fix: atomic_add_unless() returns true/false rather than prior value
[lttng-modules.git] / wrapper / kref.h
index eedefbfe87e96ab47ac79ac0c4a36565c03a47ae..f30a9aed515db306a1803ff5e4bcc2612a75801b 100644 (file)
  */
 static inline int lttng_kref_get(struct kref *kref)
 {
-       if (atomic_add_unless(&kref->refcount, 1, INT_MAX) != INT_MAX) {
-               return 1;
-       } else {
-               return 0;
-       }
+       return atomic_add_unless(&kref->refcount, 1, INT_MAX);
 }
 
 #endif /* _LTTNG_WRAPPER_KREF_H */
This page took 0.023073 seconds and 4 git commands to generate.