qcacmn: Add an API to decrement an atomic variable if it is positive
Add an API to decrement an atomic variable if its value is positive. CRs-Fixed: 3408572 Change-Id: I9649f1093850452a38acae6fa48e663a4e6d9c68
This commit is contained in:

committed by
Madan Koyyalamudi

parent
b3c257785e
commit
98f1131240
@@ -154,6 +154,18 @@ static inline int32_t qdf_atomic_dec_return(qdf_atomic_t *v)
|
||||
return __qdf_atomic_dec_return(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* qdf_atomic_dec_if_positive() - Decrement an atomic variable if its
|
||||
* value is positive
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: The old value of the variable minus 1
|
||||
*/
|
||||
static inline int32_t qdf_atomic_dec_if_positive(qdf_atomic_t *v)
|
||||
{
|
||||
return __qdf_atomic_dec_if_positive(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* qdf_atomic_inc_not_zero() - increment if not zero
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
|
Reference in New Issue
Block a user