From 2395103b3fbf2553d94a64ac3e29595cb040474b Mon Sep 17 00:00:00 2001 From: Harald Freudenberger Date: Thu, 9 Aug 2018 11:59:34 +0200 Subject: 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 Acked-by: Cornelia Huck Signed-off-by: Heiko Carstens --- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/s390') diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index bf27fc4d1335..7b9a493a3e51 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -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; } -- cgit v1.2.3