Skip to content

Commit cd5e5a3

Browse files
committed
s390/dasd: Convert to use flag output macros
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 <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent d808882 commit cd5e5a3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/s390/block/dasd_diag.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/io.h>
2626
#include <asm/irq.h>
2727
#include <asm/vtoc.h>
28+
#include <asm/asm.h>
2829

2930
#include "dasd_int.h"
3031
#include "dasd_diag.h"
@@ -67,22 +68,24 @@ static const u8 DASD_DIAG_CMS1[] = { 0xc3, 0xd4, 0xe2, 0xf1 };/* EBCDIC CMS1 */
6768
static inline int __dia250(void *iob, int cmd)
6869
{
6970
union register_pair rx = { .even = (unsigned long)iob, };
71+
int cc, exception;
7072
typedef union {
7173
struct dasd_diag_init_io init_io;
7274
struct dasd_diag_rw_io rw_io;
7375
} addr_type;
74-
int cc;
7576

76-
cc = 3;
77+
exception = 1;
7778
asm volatile(
7879
" diag %[rx],%[cmd],0x250\n"
79-
"0: ipm %[cc]\n"
80-
" srl %[cc],28\n"
80+
"0: lhi %[exc],0\n"
8181
"1:\n"
82+
CC_IPM(cc)
8283
EX_TABLE(0b,1b)
83-
: [cc] "+&d" (cc), [rx] "+&d" (rx.pair), "+m" (*(addr_type *)iob)
84+
: CC_OUT(cc, cc), [rx] "+d" (rx.pair),
85+
"+m" (*(addr_type *)iob), [exc] "+d" (exception)
8486
: [cmd] "d" (cmd)
85-
: "cc");
87+
: CC_CLOBBER);
88+
cc = exception ? 3 : CC_TRANSFORM(cc);
8689
return cc | rx.odd;
8790
}
8891

0 commit comments

Comments
 (0)