summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-02-26 08:54:48 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-02 03:18:42 (GMT)
commit1c147c83f3d663751d849cb97b5aba409f5867cb (patch)
tree0a0e18674dc2b38a980b5a3c087d0cbc6fccaa38
parent38cf948df1326f6ab82a536170a6b2e8f520a6b1 (diff)
downloadlinux-1c147c83f3d663751d849cb97b5aba409f5867cb.tar.xz
staging: lustre: ptlrpc: Replace kmem_cache_alloc with kmem_cache_zalloc
Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc with flag GFP_ZERO since kmem_alloc_zalloc sets allocated memory to zero. The Coccinelle semantic patch used to make this change is as follows: // <smpl> @@ expression e,f; @@ - kmem_cache_alloc(e, f |__GFP_ZERO) + kmem_cache_zalloc(e, f) // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 0003158..9f65a10 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -423,7 +423,7 @@ struct ptlrpc_request *ptlrpc_request_cache_alloc(gfp_t flags)
{
struct ptlrpc_request *req;
- req = kmem_cache_alloc(request_cache, flags | __GFP_ZERO);
+ req = kmem_cache_zalloc(request_cache, flags);
return req;
}