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 | ea0d1aff21b1bd3252424f200c7de510403edfa5 (patch) | |
tree | e35334b766a08664d17a92ae9f328eab0fc9552b /crypto/algapi.c | |
parent | 90df61c376d68903c14f0c5e74254f493f8861a2 (diff) | |
download | linux-crypto-ea0d1aff21b1bd3252424f200c7de510403edfa5.tar.gz linux-crypto-ea0d1aff21b1bd3252424f200c7de510403edfa5.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/algapi.c')
-rw-r--r-- | crypto/algapi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index c3b9bfee..08c57c8a 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -749,12 +749,10 @@ struct crypto_alg *crypto_attr_alg2(struct rtattr *rta, u32 type, u32 mask) { const char *name; - int err; name = crypto_attr_alg_name(rta); - err = PTR_ERR(name); if (IS_ERR(name)) - return ERR_PTR(err); + return ERR_CAST(name); return crypto_find_alg(name, frontend, type, mask); } |