lkml.org 
[lkml]   [2019]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] crypto: fix ptr_ret.cocci warnings
From: kbuild test robot <lkp@intel.com>

drivers/crypto/inside-secure/safexcel_hash.c:2081:1-3: WARNING: PTR_ERR_OR_ZERO can be used


Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 38f21b4bab11 ("crypto: inside-secure - Added support for the AES XCBC ahash")
CC: Pascal van Leeuwen <pascalvanl@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head: 504582e8e40b90b8f8c58783e2d1e4f6a2b71a3a
commit: 38f21b4bab11fc877ff18dd02f77f2c34f1105b9 [3/78] crypto: inside-secure - Added support for the AES XCBC ahash

safexcel_hash.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -2078,10 +2078,7 @@ static int safexcel_xcbcmac_cra_init(str

safexcel_ahash_cra_init(tfm);
ctx->kaes = crypto_alloc_cipher("aes", 0, 0);
- if (IS_ERR(ctx->kaes))
- return PTR_ERR(ctx->kaes);
-
- return 0;
+ return PTR_ERR_OR_ZERO(ctx->kaes);
}

static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm)
\
 
 \ /
  Last update: 2019-10-10 17:03    [W:0.644 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site