crypto: arm64/aes - Use PTR_ERR_OR_ZERO rather than its implementation.
authorzhong jiang <zhongjiang@huawei.com>
Tue, 3 Sep 2019 06:54:16 +0000 (14:54 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 9 Sep 2019 07:35:27 +0000 (17:35 +1000)
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to
use it directly. hence just replace it.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/aes-glue.c

index ca0c84d56cba0fee478bf35ed61fbf7ea855bc54..2a2e0a3fc4eb167db3e76932c353bfe74b70a30e 100644 (file)
@@ -409,10 +409,8 @@ static int essiv_cbc_init_tfm(struct crypto_skcipher *tfm)
        struct crypto_aes_essiv_cbc_ctx *ctx = crypto_skcipher_ctx(tfm);
 
        ctx->hash = crypto_alloc_shash("sha256", 0, 0);
-       if (IS_ERR(ctx->hash))
-               return PTR_ERR(ctx->hash);
 
-       return 0;
+       return PTR_ERR_OR_ZERO(ctx->hash);
 }
 
 static void essiv_cbc_exit_tfm(struct crypto_skcipher *tfm)