diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2013-01-22 12:29:26 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-02-04 21:16:53 +0800 |
commit | 3e8afe35c36fa0e928e038667709966a71a9cfa5 (patch) | |
tree | b74592dd4ec5e9fdcb89abf82374ecd9cd2e89b8 /crypto/aead.c | |
parent | 7b5c253c88ae5f6770e426b1d3f135be75483200 (diff) | |
download | linux-3e8afe35c36fa0e928e038667709966a71a9cfa5.tar.gz linux-3e8afe35c36fa0e928e038667709966a71a9cfa5.tar.bz2 linux-3e8afe35c36fa0e928e038667709966a71a9cfa5.zip |
crypto: use ERR_CAST
Replace PTR_ERR followed by ERR_PTR by ERR_CAST, to be more concise.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression err,x;
@@
- err = PTR_ERR(x);
if (IS_ERR(x))
- return ERR_PTR(err);
+ return ERR_CAST(x);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/aead.c')
-rw-r--r-- | crypto/aead.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/aead.c b/crypto/aead.c index 0b8121ebec07..4d04e12ffde8 100644 --- a/crypto/aead.c +++ b/crypto/aead.c @@ -282,18 +282,16 @@ struct crypto_instance *aead_geniv_alloc(struct crypto_template *tmpl, int err; algt = crypto_get_attr_type(tb); - err = PTR_ERR(algt); if (IS_ERR(algt)) - return ERR_PTR(err); + return ERR_CAST(algt); if ((algt->type ^ (CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_GENIV)) & algt->mask) return ERR_PTR(-EINVAL); name = crypto_attr_alg_name(tb[1]); - err = PTR_ERR(name); if (IS_ERR(name)) - return ERR_PTR(err); + return ERR_CAST(name); inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); if (!inst) |