diff options
author | Harald Freudenberger <freude@linux.ibm.com> | 2018-08-09 11:59:34 +0200 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2018-08-16 14:49:11 +0200 |
commit | 2395103b3fbf2553d94a64ac3e29595cb040474b (patch) | |
tree | f0cf13720af09121525d3bea8c63843cc587702c /arch/s390 | |
parent | bc00b3ec7722b33cb67fd2cb6bf334e03a6322c2 (diff) | |
download | talos-op-linux-2395103b3fbf2553d94a64ac3e29595cb040474b.tar.gz talos-op-linux-2395103b3fbf2553d94a64ac3e29595cb040474b.zip |
s390/zcrypt: fix ap_instructions_available() returncodes
During review of KVM patches it was complained that the
ap_instructions_available() function returns 0 if AP
instructions are available and -ENODEV if not. The function
acts like a boolean function to check for AP instructions
available and thus should return 0 on failure and != 0 on
success. Changed to the suggested behaviour and adapted
the one and only caller of this function which is the ap
bus core code.
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/ap.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/s390/include/asm/ap.h b/arch/s390/include/asm/ap.h index 046e044a48d0..887494aa164f 100644 --- a/arch/s390/include/asm/ap.h +++ b/arch/s390/include/asm/ap.h @@ -49,20 +49,20 @@ struct ap_queue_status { /** * ap_intructions_available() - Test if AP instructions are available. * - * Returns 0 if the AP instructions are installed. + * Returns 1 if the AP instructions are installed, otherwise 0. */ static inline int ap_instructions_available(void) { register unsigned long reg0 asm ("0") = AP_MKQID(0, 0); - register unsigned long reg1 asm ("1") = -ENODEV; - register unsigned long reg2 asm ("2"); + register unsigned long reg1 asm ("1") = 0; + register unsigned long reg2 asm ("2") = 0; asm volatile( " .long 0xb2af0000\n" /* PQAP(TAPQ) */ - "0: la %0,0\n" + "0: la %0,1\n" "1:\n" EX_TABLE(0b, 1b) - : "+d" (reg1), "=d" (reg2) + : "+d" (reg1), "+d" (reg2) : "d" (reg0) : "cc"); return reg1; |