From 3e8afe35c36fa0e928e038667709966a71a9cfa5 Mon Sep 17 00:00:00 2001
From: Julia Lawall
Date: Tue, 22 Jan 2013 12:29:26 +0100
Subject: 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/)
//
@@
expression err,x;
@@
- err = PTR_ERR(x);
if (IS_ERR(x))
- return ERR_PTR(err);
+ return ERR_CAST(x);
//
Signed-off-by: Julia Lawall
Signed-off-by: Herbert Xu
---
crypto/algapi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
(limited to 'crypto/algapi.c')
diff --git a/crypto/algapi.c b/crypto/algapi.c
index c3b9bfeeb7ff..08c57c8aec95 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);
}
--
cgit v1.2.3-55-g7522