Arm/atomic: correct asm() constraints in build_add_sized()
authorJan Beulich <jbeulich@suse.com>
Tue, 12 Mar 2019 13:42:17 +0000 (14:42 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Mar 2019 13:42:17 +0000 (14:42 +0100)
The memory operand is an in/out one, and the auxiliary register gets
written to early.

Take the opportunity and also drop the redundant cast (the inline
functions' parameters are already of the casted-to type).

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

index 74c73e67c407ab4f5792c4652bc0e871be20b840..7b4c987fa7d80b9441a11771808b3a6176e6dc1c 100644 (file)
@@ -30,7 +30,7 @@ static inline void name(volatile type *addr, type val)                  \
     asm volatile("ldr" size " %"width"1,%0\n"                           \
                  "add %"width"1,%"width"1,%"width"2\n"                  \
                  "str" size " %"width"1,%0"                             \
-                 : "=m" (*(volatile type *)addr), "=r" (t)              \
+                 : "+m" (*addr), "=&r" (t)                              \
                  : reg (val));                                          \
 }