summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/osc/osc_dev.c
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-02-26 14:24:55 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-01 19:18:42 -0800
commitc4418daca7a27474eda4a926f0645054516c7d7f (patch)
treecb062c45ada780fc4b00d52fe3167597da71b660 /drivers/staging/lustre/lustre/osc/osc_dev.c
parent1c147c83f3d663751d849cb97b5aba409f5867cb (diff)
downloadop-kernel-dev-c4418daca7a27474eda4a926f0645054516c7d7f.zip
op-kernel-dev-c4418daca7a27474eda4a926f0645054516c7d7f.tar.gz
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_dev.c')
-rw-r--r--drivers/staging/lustre/lustre/osc/osc_dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c b/drivers/staging/lustre/lustre/osc/osc_dev.c
index 67cb6e4..d4fe507 100644
--- a/drivers/staging/lustre/lustre/osc/osc_dev.c
+++ b/drivers/staging/lustre/lustre/osc/osc_dev.c
@@ -122,7 +122,7 @@ static void *osc_key_init(const struct lu_context *ctx,
{
struct osc_thread_info *info;
- info = kmem_cache_alloc(osc_thread_kmem, GFP_NOFS | __GFP_ZERO);
+ info = kmem_cache_zalloc(osc_thread_kmem, GFP_NOFS);
if (!info)
info = ERR_PTR(-ENOMEM);
return info;
@@ -147,7 +147,7 @@ static void *osc_session_init(const struct lu_context *ctx,
{
struct osc_session *info;
- info = kmem_cache_alloc(osc_session_kmem, GFP_NOFS | __GFP_ZERO);
+ info = kmem_cache_zalloc(osc_session_kmem, GFP_NOFS);
if (!info)
info = ERR_PTR(-ENOMEM);
return info;
OpenPOWER on IntegriCloud