The kernel will zero out the memory allocated when GFP_ZERO is set,
so no need to zero it out again.
It is possible the original intent was to memset the allocated memory
if GFP_ZERO was not set. However the only two existing callers of this
function already set GFP_ZERO.
Signed-off-by: Frank Zago <fzago@cray.com>
Change-Id: Ia7f365f91aa2ce7a302e4f794706c978222317bb
Reviewed-on: http://review.whamcloud.com/11011
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
cfs_cpt_malloc(struct cfs_cpt_table *cptab, int cpt,
size_t nr_bytes, unsigned int flags)
{
cfs_cpt_malloc(struct cfs_cpt_table *cptab, int cpt,
size_t nr_bytes, unsigned int flags)
{
- void *ptr;
-
- ptr = kmalloc_node(nr_bytes, flags,
- cfs_cpt_spread_node(cptab, cpt));
- if (ptr != NULL && (flags & __GFP_ZERO) != 0)
- memset(ptr, 0, nr_bytes);
-
- return ptr;
+ return kmalloc_node(nr_bytes, flags,
+ cfs_cpt_spread_node(cptab, cpt));
}
EXPORT_SYMBOL(cfs_cpt_malloc);
}
EXPORT_SYMBOL(cfs_cpt_malloc);