mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Slab allocators: Replace explicit zeroing with __GFP_ZERO
kmalloc_node() and kmem_cache_alloc_node() were not available in a zeroing variant in the past. But with __GFP_ZERO it is possible now to do zeroing while allocating. Use __GFP_ZERO to remove the explicit clearing of memory via memset whereever we can. Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
81cda66261
commit
94f6030ca7
12 changed files with 30 additions and 38 deletions
|
|
@ -62,10 +62,9 @@ mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
|
|||
mempool_free_t *free_fn, void *pool_data, int node_id)
|
||||
{
|
||||
mempool_t *pool;
|
||||
pool = kmalloc_node(sizeof(*pool), GFP_KERNEL, node_id);
|
||||
pool = kmalloc_node(sizeof(*pool), GFP_KERNEL | __GFP_ZERO, node_id);
|
||||
if (!pool)
|
||||
return NULL;
|
||||
memset(pool, 0, sizeof(*pool));
|
||||
pool->elements = kmalloc_node(min_nr * sizeof(void *),
|
||||
GFP_KERNEL, node_id);
|
||||
if (!pool->elements) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue