projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: atomic_add_unless() returns true/false rather than prior value
[lttng-modules.git]
/
wrapper
/
kref.h
diff --git
a/wrapper/kref.h
b/wrapper/kref.h
index eedefbfe87e96ab47ac79ac0c4a36565c03a47ae..f30a9aed515db306a1803ff5e4bcc2612a75801b 100644
(file)
--- a/
wrapper/kref.h
+++ b/
wrapper/kref.h
@@
-36,11
+36,7
@@
*/
static inline int lttng_kref_get(struct kref *kref)
{
*/
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 */
}
#endif /* _LTTNG_WRAPPER_KREF_H */
This page took
0.023735 seconds
and
4
git commands to generate.