aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/blkcipher.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2013-01-22 06:29:26 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2013-02-04 08:16:53 -0500
commit3e8afe35c36fa0e928e038667709966a71a9cfa5 (patch)
treeb74592dd4ec5e9fdcb89abf82374ecd9cd2e89b8 /crypto/blkcipher.c
parent7b5c253c88ae5f6770e426b1d3f135be75483200 (diff)
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/blkcipher.c')
-rw-r--r--crypto/blkcipher.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index a8d85a1d670e..e9e7244d5ef5 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -588,18 +588,16 @@ struct crypto_instance *skcipher_geniv_alloc(struct crypto_template *tmpl,
588 int err; 588 int err;
589 589
590 algt = crypto_get_attr_type(tb); 590 algt = crypto_get_attr_type(tb);
591 err = PTR_ERR(algt);
592 if (IS_ERR(algt)) 591 if (IS_ERR(algt))
593 return ERR_PTR(err); 592 return ERR_CAST(algt);
594 593
595 if ((algt->type ^ (CRYPTO_ALG_TYPE_GIVCIPHER | CRYPTO_ALG_GENIV)) & 594 if ((algt->type ^ (CRYPTO_ALG_TYPE_GIVCIPHER | CRYPTO_ALG_GENIV)) &
596 algt->mask) 595 algt->mask)
597 return ERR_PTR(-EINVAL); 596 return ERR_PTR(-EINVAL);
598 597
599 name = crypto_attr_alg_name(tb[1]); 598 name = crypto_attr_alg_name(tb[1]);
600 err = PTR_ERR(name);
601 if (IS_ERR(name)) 599 if (IS_ERR(name))
602 return ERR_PTR(err); 600 return ERR_CAST(name);
603 601
604 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); 602 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL);
605 if (!inst) 603 if (!inst)