staging: lustre: ptlrpc: Remove useless return variables
PATCH v4 5/5 staging: lustre: ptlrpc: Remove useless return variables
This patch removes unnecessary return variables and compresses the return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)
---
Changes in v4:
-Corrected typo lusture in the subject. Made it to lustre
drivers/staging/lustre/lustre/ptlrpc/client.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +1 -4
@@ -421,10 +421,7 @@ void ptlrpc_request_cache_fini(void)struct ptlrpc_request *ptlrpc_request_cache_alloc (gfp_t flags) { -struct ptlrpc_request *req; - - req =kmem_cache_alloc (request_cache, flags | __GFP_ZERO); -return req; +return kmem_cache_alloc (request_cache, flags | __GFP_ZERO); }void ptlrpc_request_cache_free (struct ptlrpc_request *req)
--
2.1.4
Greg KH
maintainerQuoted 29 lines · Bhaktipriya Shridhar
This patch removes unnecessary return variables and compresses the return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v4:
-Corrected typo lusture in the subject. Made it to lustredrivers/staging/lustre/lustre/ptlrpc/client.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/staging/lustre/lustre/ptlrpc/client.c +0
-0@@ -421,10 +421,7 @@ void ptlrpc_request_cache_fini(void)
drivers/staging/lustre/lustre/ptlrpc/client.c void ptlrpc_request_cache_fini(void) · line 427
Quoted 10 lines
drivers/staging/lustre/lustre/ptlrpc/client.c +1
-4struct ptlrpc_request *ptlrpc_request_cache_alloc (gfp_t flags) { -struct ptlrpc_request *req; - - req =kmem_cache_alloc (request_cache, flags | __GFP_ZERO); -return req; +return kmem_cache_alloc (request_cache, flags | __GFP_ZERO); }void ptlrpc_request_cache_free (struct ptlrpc_request *req)
This patch didn't apply :(
Greg KH
maintainerQuoted 29 lines · Bhaktipriya Shridhar
This patch removes unnecessary return variables and compresses the return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v4:
-Corrected typo lusture in the subject. Made it to lustredrivers/staging/lustre/lustre/ptlrpc/client.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/staging/lustre/lustre/ptlrpc/client.c +0
-0@@ -421,10 +421,7 @@ void ptlrpc_request_cache_fini(void)
drivers/staging/lustre/lustre/ptlrpc/client.c void ptlrpc_request_cache_fini(void) · line 427
Quoted 10 lines
drivers/staging/lustre/lustre/ptlrpc/client.c +1
-4struct ptlrpc_request *ptlrpc_request_cache_alloc (gfp_t flags) { -struct ptlrpc_request *req; - - req =kmem_cache_alloc (request_cache, flags | __GFP_ZERO); -return req; +return kmem_cache_alloc (request_cache, flags | __GFP_ZERO); }void ptlrpc_request_cache_free (struct ptlrpc_request *req)
This patch didn't apply :(