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 <[email protected]>
Acked-by: Cornelia Huck <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
This commit is contained in:
Harald Freudenberger 2018-08-09 11:59:34 +02:00 • committed by Heiko Carstens
commit 2395103b3f
2 changed files with 6 additions and 6 deletions

View file

@ -1201,7 +1201,7 @@ static int __init ap_module_init(void)
if (rc)
return rc;
if (ap_instructions_available() != 0) {
if (!ap_instructions_available()) {
pr_warn("The hardware system does not support AP instructions\n");
return -ENODEV;
}