crypto: Use PTR_ERR_ZERO
authorHimanshu Jha <himanshujha199640@gmail.com>
Sun, 27 Aug 2017 06:22:48 +0000 (11:52 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Sep 2017 09:43:27 +0000 (17:43 +0800)
Use PTR_ERROR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.
Build successfully.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/tdma.c
drivers/crypto/mv_cesa.c
drivers/crypto/qce/ablkcipher.c

index c76375f..d0ef171 100644 (file)
@@ -304,10 +304,7 @@ int mv_cesa_dma_add_dummy_launch(struct mv_cesa_tdma_chain *chain, gfp_t flags)
        struct mv_cesa_tdma_desc *tdma;
 
        tdma = mv_cesa_dma_add_desc(chain, flags);
-       if (IS_ERR(tdma))
-               return PTR_ERR(tdma);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(tdma);
 }
 
 int mv_cesa_dma_add_dummy_end(struct mv_cesa_tdma_chain *chain, gfp_t flags)
index bf25f41..c3883b4 100644 (file)
@@ -1052,10 +1052,7 @@ static int mv_cesa_get_sram(struct platform_device *pdev,
                return -EINVAL;
 
        cp->sram = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(cp->sram))
-               return PTR_ERR(cp->sram);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(cp->sram);
 }
 
 static int mv_probe(struct platform_device *pdev)
index b04b42f..ea4d96b 100644 (file)
@@ -248,10 +248,7 @@ static int qce_ablkcipher_init(struct crypto_tfm *tfm)
        ctx->fallback = crypto_alloc_skcipher(crypto_tfm_alg_name(tfm), 0,
                                              CRYPTO_ALG_ASYNC |
                                              CRYPTO_ALG_NEED_FALLBACK);
-       if (IS_ERR(ctx->fallback))
-               return PTR_ERR(ctx->fallback);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(ctx->fallback);
 }
 
 static void qce_ablkcipher_exit(struct crypto_tfm *tfm)