Lines Matching refs:val
78 unsigned int old, new, val = atomic_read(&r->refs); in refcount_inc_not_zero() local
81 new = val + 1; in refcount_inc_not_zero()
83 if (!val) in refcount_inc_not_zero()
89 old = atomic_cmpxchg_relaxed(&r->refs, val, new); in refcount_inc_not_zero()
90 if (old == val) in refcount_inc_not_zero()
93 val = old; in refcount_inc_not_zero()
123 unsigned int old, new, val = atomic_read(&r->refs); in refcount_sub_and_test() local
126 if (unlikely(val == UINT_MAX)) in refcount_sub_and_test()
129 new = val - i; in refcount_sub_and_test()
130 if (new > val) { in refcount_sub_and_test()
131 REFCOUNT_WARN(new > val, "refcount_t: underflow; use-after-free.\n"); in refcount_sub_and_test()
135 old = atomic_cmpxchg_release(&r->refs, val, new); in refcount_sub_and_test()
136 if (old == val) in refcount_sub_and_test()
139 val = old; in refcount_sub_and_test()