]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/cpcmd: Convert to use flag output macros
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Nov 2024 15:11:37 +0000 (16:11 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 13 Nov 2024 13:31:32 +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/kernel/cpcmd.c

index b210a29d3ee96189533bde9a1e1402fce5a548af..2f4174b961def0b3be4fde87e23f3ba3c1ef0b10 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/diag.h>
 #include <asm/ebcdic.h>
 #include <asm/cpcmd.h>
+#include <asm/asm.h>
 
 static DEFINE_SPINLOCK(cpcmd_lock);
 static char cpcmd_buf[241];
@@ -45,12 +46,11 @@ static int diag8_response(int cmdlen, char *response, int *rlen)
        ry.odd  = *rlen;
        asm volatile(
                "       diag    %[rx],%[ry],0x8\n"
-               "       ipm     %[cc]\n"
-               "       srl     %[cc],28\n"
-               : [cc] "=&d" (cc), [ry] "+&d" (ry.pair)
+               CC_IPM(cc)
+               : CC_OUT(cc, cc), [ry] "+d" (ry.pair)
                : [rx] "d" (rx.pair)
-               : "cc");
-       if (cc)
+               : CC_CLOBBER);
+       if (CC_TRANSFORM(cc))
                *rlen += ry.odd;
        else
                *rlen = ry.odd;