diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-07-17 07:03:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:02 -0400 |
commit | 94f6030ca792c57422f04a73e7a872d8325946d3 (patch) | |
tree | 0197f24d82b1706f1b0521f2cf68feeff64123df /lib/genalloc.c | |
parent | 81cda6626178cd55297831296ba8ecedbfd8b52d (diff) |
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 <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/genalloc.c')
-rw-r--r-- | lib/genalloc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/genalloc.c b/lib/genalloc.c index eb7c2bab9ebf..f6d276db2d58 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c | |||
@@ -54,11 +54,10 @@ int gen_pool_add(struct gen_pool *pool, unsigned long addr, size_t size, | |||
54 | int nbytes = sizeof(struct gen_pool_chunk) + | 54 | int nbytes = sizeof(struct gen_pool_chunk) + |
55 | (nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE; | 55 | (nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE; |
56 | 56 | ||
57 | chunk = kmalloc_node(nbytes, GFP_KERNEL, nid); | 57 | chunk = kmalloc_node(nbytes, GFP_KERNEL | __GFP_ZERO, nid); |
58 | if (unlikely(chunk == NULL)) | 58 | if (unlikely(chunk == NULL)) |
59 | return -1; | 59 | return -1; |
60 | 60 | ||
61 | memset(chunk, 0, nbytes); | ||
62 | spin_lock_init(&chunk->lock); | 61 | spin_lock_init(&chunk->lock); |
63 | chunk->start_addr = addr; | 62 | chunk->start_addr = addr; |
64 | chunk->end_addr = addr + size; | 63 | chunk->end_addr = addr + size; |