linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Will Deacon <will@kernel.org>, <herbert@gondor.apana.org.au>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
	davem@davemloft.net, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation.
Date: Thu, 5 Sep 2019 14:25:27 +0800	[thread overview]
Message-ID: <5D70AA57.5080700@huawei.com> (raw)
In-Reply-To: <20190904102526.5vtdv5ofuezn7fre@willie-the-truck>

On 2019/9/4 18:25, Will Deacon wrote:
> On Tue, Sep 03, 2019 at 02:54:16PM +0800, zhong jiang wrote:
>> 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>
>> ---
>>  arch/arm64/crypto/aes-glue.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/arch/arm64/crypto/aes-glue.c b/arch/arm64/crypto/aes-glue.c
>> index ca0c84d..2a2e0a3 100644
>> --- a/arch/arm64/crypto/aes-glue.c
>> +++ b/arch/arm64/crypto/aes-glue.c
>> @@ -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)
> Acked-by: Will Deacon <will@kernel.org>
Thanks.

Sincerely,
zhong jiang
> Assuming this will go via Herbert.
>
> Will
>
> .
>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-09-05  6:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03  6:54 [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation zhong jiang
2019-09-04 10:25 ` Will Deacon
2019-09-05  6:25   ` zhong jiang [this message]
2019-09-09  7:48 ` 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=5D70AA57.5080700@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /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 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).