Re: [PATCH] kvm: remove the duplicated cpumask_clear

Rusty Russell
2009-06-12T11:49:29Z

On Fri, 12 Jun 2009 07:39:00 am Yinghai Lu wrote:
> zalloc_cpumask_var already had that clear.

Only because of your previous patch... I've folded them into one patch for
Avi:

Subject: kvm: use zalloc_cpumask_var instead of cpumask_clear

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
virt/kvm/kvm_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2301,11 +2301,10 @@ int kvm_init(void *opaque, unsigned int

bad_pfn = page_to_pfn(bad_page);

- if (!alloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
+ if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
r = -ENOMEM;
goto out_free_0;
}
- cpumask_clear(cpus_hardware_enabled);

r = kvm_arch_hardware_setup();
if (r < 0)