[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 7/7] Arm/atomic: cosmetics



Correct coding style of asm() invocations. Drop redundant casts.
Un-define no longer needed macros after use.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/asm-arm/atomic.h
+++ b/xen/include/asm-arm/atomic.h
@@ -9,29 +9,29 @@
 static inline type name(const volatile type *addr) \
 {                                                  \
     type ret;                                      \
-    asm volatile("ldr" size " %" width(0) ",%1"    \
-                 : "=r" (ret)                      \
-                 : "m" (*(volatile type *)addr));  \
+    asm volatile ( "ldr" size " %" width(0) ",%1"  \
+                   : "=r" (ret)                    \
+                   : "m" (*addr) );                \
     return ret;                                    \
 }
 
 #define build_atomic_write(name, size, width, type)    \
 static inline void name(volatile type *addr, type val) \
 {                                                      \
-    asm volatile("str" size " %" width(1) ",%0"        \
-                 : "=m" (*(volatile type *)addr)       \
-                 : "r" (val));                         \
+    asm volatile ( "str" size " %" width(1) ",%0"      \
+                   : "=m" (*addr)                      \
+                   : "r" (val) );                      \
 }
 
-#define build_add_sized(name, size, width, type)                        \
-static inline void name(volatile type *addr, type val)                  \
-{                                                                       \
-    type t;                                                             \
-    asm volatile("ldr" size " %" width(1) ",%0\n"                       \
-                 "add %" width(1) ",%" width(1) ",%" width(2) "\n"      \
-                 "str" size " %" width(1) ",%0"                         \
-                 : "+m" (*addr), "=&r" (t)                              \
-                 : "ri" (val));                                         \
+#define build_add_sized(name, size, width, type)                     \
+static inline void name(volatile type *addr, type val)               \
+{                                                                    \
+    type t;                                                          \
+    asm volatile ( "ldr" size " %" width(1) ",%0\n"                  \
+                   "add %" width(1) ",%" width(1) ",%" width(2) "\n" \
+                   "str" size " %" width(1) ",%0"                    \
+                   : "+m" (*addr), "=&r" (t)                         \
+                   : "ri" (val) );                                   \
 }
 
 #if defined (CONFIG_ARM_32)
@@ -62,6 +62,15 @@ build_add_sized(add_u8_sized, "b", BYTE,
 build_add_sized(add_u16_sized, "h", WORD, uint16_t)
 build_add_sized(add_u32_sized, "", WORD, uint32_t)
 
+#undef BYTE
+#undef WORD
+#undef DWORD
+#undef PAIR
+
+#undef build_atomic_read
+#undef build_atomic_write
+#undef build_add_sized
+
 void __bad_atomic_size(void);
 
 #define read_atomic(p) ({                                               \





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.