Skip to contentSkip to conversation

s390/xor: Fix xor_xc_2() inline assembly constraints

PATCH In review Heiko Carstens 1 participant 2 messages Feb 27 s390

lore
Share & tools
lore

Heiko Carstens

author maintainer
#0 lore raw

PATCH 1/1 s390/xor: Fix xor_xc_2() inline assembly constraints

The inline assembly constraints for xor_xc_2() are incorrect. "bytes", "p1", and "p2" are input operands, while all three of them are modified within the inline assembly. Given that the function consists only of this inline assembly it seems unlikely that this may cause any problems, however fix this in any case.

---
 arch/s390/lib/xor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/s390/lib/xor.c +2 -2
index 1721b73b7803..d703c44d5fd6 100644
@@ -28,8 +28,8 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,
 		"	j	3f\n"
 		"2:	xc	0(1,%1),0(%2)\n"
 		"3:"
-		: : "d" (bytes), "a" (p1), "a" (p2)
-		: "0", "cc", "memory");
+		: "+d" (bytes), "+a" (p1), "+a" (p2)
+		: : "0", "cc", "memory");
 }
 
 static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1,
Signature · 1 line
2.51.0
author maintainer
#1 lore raw
Quoted 11 lines · Heiko Carstens

The inline assembly constraints for xor_xc_2() are incorrect. "bytes", "p1", and "p2" are input operands, while all three of them are modified within the inline assembly. Given that the function consists only of this inline assembly it seems unlikely that this may cause any problems, however fix this in any case.

---
 arch/s390/lib/xor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Ignore this patch. While looking at xor.c again I realized that all inline assembly constraints are incorrect. Will send an updated version next week.