All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Van Leeuwen <pvanleeuwen@verimatrix.com>
To: YueHaibing <yuehaibing@huawei.com>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
Date: Wed, 9 Oct 2019 13:28:47 +0000	[thread overview]
Message-ID: <MN2PR20MB29737A41C34E055FB7FFD9FBCA950@MN2PR20MB2973.namprd20.prod.outlook.com> (raw)
In-Reply-To: <20191009120621.45834-1-yuehaibing@huawei.com>

> -----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


WARNING: multiple messages have this Message-ID (diff)
From: Pascal Van Leeuwen <pvanleeuwen@verimatrix.com>
To: YueHaibing <yuehaibing@huawei.com>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init()
Date: Wed, 09 Oct 2019 13:28:47 +0000	[thread overview]
Message-ID: <MN2PR20MB29737A41C34E055FB7FFD9FBCA950@MN2PR20MB2973.namprd20.prod.outlook.com> (raw)
In-Reply-To: <20191009120621.45834-1-yuehaibing@huawei.com>

> -----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

  parent reply	other threads:[~2019-10-09 13:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 12:06 [PATCH -next] crypto: Use PTR_ERR_OR_ZERO in safexcel_xcbcmac_cra_init() YueHaibing
2019-10-09 12:06 ` YueHaibing
2019-10-09 12:13 ` Antoine Tenart
2019-10-09 12:13   ` Antoine Tenart
2019-10-09 13:28 ` Pascal Van Leeuwen [this message]
2019-10-09 13:28   ` Pascal Van Leeuwen
2019-10-18  8:02 ` Herbert Xu
2019-10-18  8:02   ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR20MB29737A41C34E055FB7FFD9FBCA950@MN2PR20MB2973.namprd20.prod.outlook.com \
    --to=pvanleeuwen@verimatrix.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.