Skip to contentSkip to conversation

x86/asm: Use inout "+" asm onstraint modifiers in __iowrite32_copy()

PATCH RESEND Superseded Uros Bizjak 2 participants 2 messages Nov 10, 2025 – Jan 20 x86

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 x86/asm: Use inout "+" asm onstraint modifiers in __iowrite32_copy()

Use inout "+" asm constraint modifiers to simplify asm operands.

No functional changes intended.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/include/asm/io.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/include/asm/io.h +2 -3
index ca309a3227c7..2ea25745e059 100644
@@ -218,9 +218,8 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from,
 				    size_t count)
 {
 	asm volatile("rep movsl"
-		     : "=&c"(count), "=&D"(to), "=&S"(from)
-		     : "0"(count), "1"(to), "2"(from)
-		     : "memory");
+		     : "+D"(to), "+S"(from), "+c"(count)
+		     : : "memory");
 }
 #define __iowrite32_copy __iowrite32_copy
 #endif
Signature · 1 line
2.51.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Uros Bizjak

Use inout "+" asm constraint modifiers to simplify asm operands.

No functional changes intended.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Quoted 3 lines
---
 arch/x86/include/asm/io.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Looks good to me.

Quoted 16 lines
arch/x86/include/asm/io.h +2 -3
index ca309a3227c7..2ea25745e059 100644
@@ -218,9 +218,8 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from,
 				    size_t count)
 {
 	asm volatile("rep movsl"
-		     : "=&c"(count), "=&D"(to), "=&S"(from)
-		     : "0"(count), "1"(to), "2"(from)
-		     : "memory");
+		     : "+D"(to), "+S"(from), "+c"(count)
+		     : : "memory");
 }
 #define __iowrite32_copy __iowrite32_copy
 #endif