From: zhong jiang <zhongjiang@huawei.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<catalin.marinas@arm.com>
Cc: <will@kernel.org>, <zhongjiang@huawei.com>,
<linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation.
Date: Tue, 3 Sep 2019 14:54:16 +0800 [thread overview]
Message-ID: <1567493656-19916-1-git-send-email-zhongjiang@huawei.com> (raw)
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)
--
1.7.12.4
next reply other threads:[~2019-09-03 6:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 6:54 zhong jiang [this message]
2019-09-04 10:25 ` Will Deacon
2019-09-05 6:25 ` zhong jiang
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=1567493656-19916-1-git-send-email-zhongjiang@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
all inboxes | Powered by JetHome®