提交 559fa6e7 编写于 作者: J Jesper Juhl 提交者: Ingo Molnar

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

There's no reason to memset() manually when we have vzalloc().
Signed-off-by: NJesper Juhl <jj@chaosbits.net>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: William Irwin <wli@holomorphy.com>
LKML-Reference: <alpine.LNX.2.00.1010302150310.1572@swampdragon.chaosbits.net>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 3985c7ce
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册