]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/string: Convert to use flag output macros
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Nov 2024 15:11:45 +0000 (16:11 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 13 Nov 2024 13:31:33 +0000 (14:31 +0100)
Use flag output macros in inline asm to allow for better code generation if
the compiler has support for the flag output constraint.

Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/lib/string.c

index 7d87418182397a2848e45ae131b86319513de687..373fa1f019376d8c71b7d3194b51eedf7f7b14fc 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/export.h>
+#include <asm/asm.h>
 
 /*
  * Helper functions to find the end of a string
@@ -238,12 +239,11 @@ static inline int clcle(const char *s1, unsigned long l1,
        asm volatile(
                "0:     clcle   %[r1],%[r3],0\n"
                "       jo      0b\n"
-               "       ipm     %[cc]\n"
-               "       srl     %[cc],28\n"
-               : [cc] "=&d" (cc), [r1] "+&d" (r1.pair), [r3] "+&d" (r3.pair)
+               CC_IPM(cc)
+               : CC_OUT(cc, cc), [r1] "+d" (r1.pair), [r3] "+d" (r3.pair)
                :
-               : "cc", "memory");
-       return cc;
+               : CC_CLOBBER_LIST("memory"));
+       return CC_TRANSFORM(cc);
 }
 
 /**