staging: lusture: ptlrpc: Remove useless return variables
PATCH v2 8/8 staging: lusture: 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;
)
Signed-off-by Bhaktipriya Shridhar <[email protected]>
---
Changes in v2:
-No change
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