Browse Source

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
Houston Hoffman 9 years ago
parent
commit
4cf4763fb1
2 changed files with 24 additions and 0 deletions
  1. 12 0
      core/cdf/inc/cdf_atomic.h
  2. 12 0
      core/cdf/src/i_cdf_atomic.h

+ 12 - 0
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

+ 12 - 0
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);