diff mbox

[v5,6/7] asm-arm/atomic.h: atomic_{inc, dec}_return: macros to inline functions

Message ID 1468579560-20027-1-git-send-email-czuzu@bitdefender.com (mailing list archive)
State New, archived
Headers show

Commit Message

Corneliu ZUZU July 15, 2016, 10:46 a.m. UTC
Turn atomic_inc_return and atomic_dec_return atomic.h macros to inline
functions.

Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changed since v4:
  * README.LinuxPrimitives not updated anymore
---
 xen/include/asm-arm/atomic.h | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h
index 91f05c8..f060c5a 100644
--- a/xen/include/asm-arm/atomic.h
+++ b/xen/include/asm-arm/atomic.h
@@ -130,9 +130,6 @@  static inline void _atomic_set(atomic_t *v, int i)
 # error "unknown ARM variant"
 #endif
 
-#define atomic_inc_return(v)        (atomic_add_return(1, v))
-#define atomic_dec_return(v)        (atomic_sub_return(1, v))
-
 static inline int atomic_sub_and_test(int i, atomic_t *v)
 {
     return atomic_sub_return(i, v) == 0;
@@ -143,6 +140,11 @@  static inline void atomic_inc(atomic_t *v)
     atomic_add(1, v);
 }
 
+static inline int atomic_inc_return(atomic_t *v)
+{
+    return atomic_add_return(1, v);
+}
+
 static inline int atomic_inc_and_test(atomic_t *v)
 {
     return atomic_add_return(1, v) == 0;
@@ -153,6 +155,11 @@  static inline void atomic_dec(atomic_t *v)
     atomic_sub(1, v);
 }
 
+static inline int atomic_dec_return(atomic_t *v)
+{
+    return atomic_sub_return(1, v);
+}
+
 static inline int atomic_dec_and_test(atomic_t *v)
 {
     return atomic_sub_return(1, v) == 0;