diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-26 14:24:55 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-01 19:18:42 -0800 |
commit | c4418daca7a27474eda4a926f0645054516c7d7f (patch) | |
tree | cb062c45ada780fc4b00d52fe3167597da71b660 /drivers/staging/lustre/lustre/osc/osc_object.c | |
parent | staging: lustre: ptlrpc: Replace kmem_cache_alloc with kmem_cache_zalloc (diff) | |
download | linux-dev-c4418daca7a27474eda4a926f0645054516c7d7f.tar.xz linux-dev-c4418daca7a27474eda4a926f0645054516c7d7f.zip |
staging: lustre: osc: 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/osc/osc_object.c')
-rw-r--r-- | drivers/staging/lustre/lustre/osc/osc_object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/osc/osc_object.c b/drivers/staging/lustre/lustre/osc/osc_object.c index 60d8230e3a4b..9d474fcdd9a7 100644 --- a/drivers/staging/lustre/lustre/osc/osc_object.c +++ b/drivers/staging/lustre/lustre/osc/osc_object.c @@ -255,7 +255,7 @@ struct lu_object *osc_object_alloc(const struct lu_env *env, struct osc_object *osc; struct lu_object *obj; - osc = kmem_cache_alloc(osc_object_kmem, GFP_NOFS | __GFP_ZERO); + osc = kmem_cache_zalloc(osc_object_kmem, GFP_NOFS); if (osc) { obj = osc2lu(osc); lu_object_init(obj, NULL, dev); |