From 4cf4763fb1be1ccdcdb468802e828fc19d8f83b3 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Sun, 6 Dec 2015 20:29:12 -0800 Subject: [PATCH] qcacld-3.0: Support atomic sub in cdf qcacld-2.0 to qcacld-3.0 propagation support atomic_sub in cdf Change-Id: Ie03c786f96533063b429fa3ea011e6e05c9504e2 CRs-Fixed: 938145 --- core/cdf/inc/cdf_atomic.h | 12 ++++++++++++ core/cdf/src/i_cdf_atomic.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/core/cdf/inc/cdf_atomic.h b/core/cdf/inc/cdf_atomic.h index 230d4eda3057..a30d52bccae7 100644 --- a/core/cdf/inc/cdf_atomic.h +++ b/core/cdf/inc/cdf_atomic.h @@ -101,6 +101,18 @@ static inline void cdf_atomic_add(int i, cdf_atomic_t *v) __cdf_atomic_add(i, v); } +/** + * cdf_atomic_sub() - Subtract a value from an atomic variable. + * @i: the amount by which to decrease the atomic counter + * @v: a pointer to an opaque atomic variable + * + * Return: none + */ +static inline void cdf_atomic_sub(int i, cdf_atomic_t *v) +{ + __cdf_atomic_sub(i, v); +} + /** * cdf_atomic_dec_and_test() - decrement an atomic variable and check if the * new value is zero diff --git a/core/cdf/src/i_cdf_atomic.h b/core/cdf/src/i_cdf_atomic.h index f74b7dfd47c7..7c08eb982a78 100644 --- a/core/cdf/src/i_cdf_atomic.h +++ b/core/cdf/src/i_cdf_atomic.h @@ -60,6 +60,18 @@ static inline void __cdf_atomic_add(int i, __cdf_atomic_t *v) atomic_add(i, v); } +/** + * cdf_atomic_sub() - Subtract a value from an atomic variable + * @i: the amount by which to decrease the atomic counter + * @v: a pointer to an opaque atomic variable + * + * Return: none + */ +static inline void __cdf_atomic_sub(int i, __cdf_atomic_t *v) +{ + atomic_sub(i, v); +} + static inline uint32_t __cdf_atomic_dec_and_test(__cdf_atomic_t *v) { return atomic_dec_and_test(v);