[PATCH] profile: Use vzalloc rather than vmalloc & memset

From: Jesper Juhl
Date: Sat Oct 30 2010 - 16:06:52 EST


Hi,

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


Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
---
profile.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Compile tested only.

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;


--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Plain text mails only, please http://www.expita.com/nomime.html
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html

--
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/