linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
@ 2019-10-09 12:06 YueHaibing
  2019-10-09 12:13 ` Antoine Tenart
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: YueHaibing @ 2019-10-09 12:06 UTC (permalink / raw)
  To: Antoine Tenart, Herbert Xu; +Cc: YueHaibing, linux-crypto, kernel-janitors

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

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/inside-secure/safexcel_hash.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 85c3a075f283..a07a2915fab1 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -2109,10 +2109,7 @@ static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm)
 
 	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)






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
  2019-10-09 12:06 [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init() YueHaibing
@ 2019-10-09 12:13 ` Antoine Tenart
  2019-10-09 13:28 ` Pascal Van Leeuwen
  2019-10-18  8:02 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Antoine Tenart @ 2019-10-09 12:13 UTC (permalink / raw)
  To: YueHaibing; +Cc: Antoine Tenart, Herbert Xu, linux-crypto, kernel-janitors

On Wed, Oct 09, 2019 at 12:06:21PM +0000, YueHaibing wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Antoine Tenart <antoine.tenart@ack.tf>

Thanks,
Antoine

> ---
>  drivers/crypto/inside-secure/safexcel_hash.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
> index 85c3a075f283..a07a2915fab1 100644
> --- a/drivers/crypto/inside-secure/safexcel_hash.c
> +++ b/drivers/crypto/inside-secure/safexcel_hash.c
> @@ -2109,10 +2109,7 @@ static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm)
>  
>  	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)
> 
> 
> 
> 
> 

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
  2019-10-09 12:06 [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init() YueHaibing
  2019-10-09 12:13 ` Antoine Tenart
@ 2019-10-09 13:28 ` Pascal Van Leeuwen
  2019-10-18  8:02 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Pascal Van Leeuwen @ 2019-10-09 13:28 UTC (permalink / raw)
  To: YueHaibing, Antoine Tenart, Herbert Xu; +Cc: linux-crypto, kernel-janitors

> -----Original Message-----
> From: linux-crypto-owner@vger.kernel.org <linux-crypto-owner@vger.kernel.org> On Behalf Of
> YueHaibing
> Sent: Wednesday, October 9, 2019 2:06 PM
> To: Antoine Tenart <antoine.tenart@bootlin.com>; Herbert Xu <herbert@gondor.apana.org.au>
> Cc: YueHaibing <yuehaibing@huawei.com>; linux-crypto@vger.kernel.org; kernel-
> janitors@vger.kernel.org
> Subject: [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
> 
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
Acked-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>

> ---
>  drivers/crypto/inside-secure/safexcel_hash.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-
> secure/safexcel_hash.c
> index 85c3a075f283..a07a2915fab1 100644
> --- a/drivers/crypto/inside-secure/safexcel_hash.c
> +++ b/drivers/crypto/inside-secure/safexcel_hash.c
> @@ -2109,10 +2109,7 @@ static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm)
> 
>  	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);
>
Ah cool, you can do that in one go, didn't know that yet :-) Thanks!

>  }
> 
>  static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm)
> 
> 
> 
> 

Regards,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Verimatrix
www.insidesecure.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
  2019-10-09 12:06 [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init() YueHaibing
  2019-10-09 12:13 ` Antoine Tenart
  2019-10-09 13:28 ` Pascal Van Leeuwen
@ 2019-10-18  8:02 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2019-10-18  8:02 UTC (permalink / raw)
  To: YueHaibing; +Cc: Antoine Tenart, linux-crypto, kernel-janitors

On Wed, Oct 09, 2019 at 12:06:21PM +0000, YueHaibing wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/inside-secure/safexcel_hash.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-18  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 12:06 [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init() YueHaibing
2019-10-09 12:13 ` Antoine Tenart
2019-10-09 13:28 ` Pascal Van Leeuwen
2019-10-18  8:02 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).