diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2013-01-22 06:29:26 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-02-04 08:16:53 -0500 |
commit | 3e8afe35c36fa0e928e038667709966a71a9cfa5 (patch) | |
tree | b74592dd4ec5e9fdcb89abf82374ecd9cd2e89b8 /crypto/ctr.c | |
parent | 7b5c253c88ae5f6770e426b1d3f135be75483200 (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/ctr.c')
-rw-r--r-- | crypto/ctr.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/ctr.c b/crypto/ctr.c index 4ca7222cfeb6..095dcb66d72d 100644 --- a/crypto/ctr.c +++ b/crypto/ctr.c | |||
@@ -334,9 +334,8 @@ static struct crypto_instance *crypto_rfc3686_alloc(struct rtattr **tb) | |||
334 | 334 | ||
335 | alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_BLKCIPHER, | 335 | alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_BLKCIPHER, |
336 | CRYPTO_ALG_TYPE_MASK); | 336 | CRYPTO_ALG_TYPE_MASK); |
337 | err = PTR_ERR(alg); | ||
338 | if (IS_ERR(alg)) | 337 | if (IS_ERR(alg)) |
339 | return ERR_PTR(err); | 338 | return ERR_CAST(alg); |
340 | 339 | ||
341 | /* We only support 16-byte blocks. */ | 340 | /* We only support 16-byte blocks. */ |
342 | err = -EINVAL; | 341 | err = -EINVAL; |