diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-26 14:25:02 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-01 19:18:42 -0800 |
commit | 3eed2d000275d8b6352cffeb60e79e55239f1f16 (patch) | |
tree | 3046d96c9709dd2b74105222c6174210828d0931 /drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | |
parent | c4418daca7a27474eda4a926f0645054516c7d7f (diff) | |
download | op-kernel-dev-3eed2d000275d8b6352cffeb60e79e55239f1f16.zip op-kernel-dev-3eed2d000275d8b6352cffeb60e79e55239f1f16.tar.gz |
staging: lustre: ldlm: 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>
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_resource.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 03b9726..9dede87 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -1041,7 +1041,7 @@ static struct ldlm_resource *ldlm_resource_new(void) struct ldlm_resource *res; int idx; - res = kmem_cache_alloc(ldlm_resource_slab, GFP_NOFS | __GFP_ZERO); + res = kmem_cache_zalloc(ldlm_resource_slab, GFP_NOFS); if (!res) return NULL; |