[tip:perf/core] profile: Use vzalloc() rather than vmalloc() & memset()

From: tip-bot for Jesper Juhl
Date: Sun Oct 31 2010 - 11:18:11 EST


Commit-ID: 559fa6e76b271b98ff641fa2a968aa2439e43c28
Gitweb: http://git.kernel.org/tip/559fa6e76b271b98ff641fa2a968aa2439e43c28
Author: Jesper Juhl <jj@xxxxxxxxxxxxx>
AuthorDate: Sat, 30 Oct 2010 21:56:26 +0200
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Sun, 31 Oct 2010 09:47:26 +0100

profile: Use vzalloc() rather than vmalloc() & memset()

There's no reason to memset() manually when we have vzalloc().

Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxx>
Cc: William Irwin <wli@xxxxxxxxxxxxxx>
LKML-Reference: <alpine.LNX.2.00.1010302150310.1572@xxxxxxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
kernel/profile.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/profile.c b/kernel/profile.c
index 66f841b..14c9f87 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -126,11 +126,9 @@ int __ref profile_init(void)
if (prof_buffer)
return 0;

- prof_buffer = vmalloc(buffer_bytes);
- if (prof_buffer) {
- memset(prof_buffer, 0, buffer_bytes);
+ prof_buffer = vzalloc(buffer_bytes);
+ if (prof_buffer)
return 0;
- }

free_cpumask_var(prof_cpu_mask);
return -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/