]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
Arm/atomic: cosmetics
authorJan Beulich <jbeulich@suse.com>
Thu, 14 Mar 2019 15:40:12 +0000 (16:40 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 14 Mar 2019 15:40:12 +0000 (16:40 +0100)
Drop redundant casts. Un-define no longer needed macros after use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/include/asm-arm/atomic.h

index 0a136590fec6b438c48ccb99b011f880cde98f64..e81bf80e305c88afdc6e5f7f3af81d77abd7e251 100644 (file)
@@ -11,7 +11,7 @@ static inline type name(const volatile type *addr) \
     type ret;                                      \
     asm volatile("ldr" size " %" width(0) ",%1"    \
                  : "=r" (ret)                      \
-                 : "m" (*(volatile type *)addr));  \
+                 : "m" (*addr));                   \
     return ret;                                    \
 }
 
@@ -19,7 +19,7 @@ static inline type name(const volatile type *addr) \
 static inline void name(volatile type *addr, type val) \
 {                                                      \
     asm volatile("str" size " %" width(1) ",%0"        \
-                 : "=m" (*(volatile type *)addr)       \
+                 : "=m" (*addr)                        \
                  : "r" (val));                         \
 }
 
@@ -62,6 +62,15 @@ build_add_sized(add_u8_sized, "b", BYTE, uint8_t)
 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) ({                                               \