From: Jan Beulich Date: Tue, 12 Mar 2019 13:42:17 +0000 (+0100) Subject: Arm/atomic: correct asm() constraints in build_add_sized() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2497 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=51ceb1623b9956440f1b9943c67010a90d61f5c5;p=xen.git Arm/atomic: correct asm() constraints in build_add_sized() 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 Reviewed-by: Julien Grall --- diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h index 74c73e67c4..7b4c987fa7 100644 --- a/xen/include/asm-arm/atomic.h +++ b/xen/include/asm-arm/atomic.h @@ -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)); \ }