aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-02-09 11:38:40 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-09 12:14:07 -0500
commit8b6d44c7bde7f927b7b70e9f56c22c66c0066277 (patch)
tree7246847130b1768908c7c87fef2dc99028e29300 /drivers
parent5b71bddb78df5e292ae90f7603a996e51b3ecb88 (diff)
[PATCH] kvm: NULL noise removal
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/kvm/kvm_main.c28
-rw-r--r--drivers/kvm/svm.c8
-rw-r--r--drivers/kvm/vmx.c2
3 files changed, 19 insertions, 19 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index a55354009cbb..099f0afd394d 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -62,7 +62,7 @@ static struct kvm_stats_debugfs_item {
62 { "halt_exits", &kvm_stat.halt_exits }, 62 { "halt_exits", &kvm_stat.halt_exits },
63 { "request_irq", &kvm_stat.request_irq_exits }, 63 { "request_irq", &kvm_stat.request_irq_exits },
64 { "irq_exits", &kvm_stat.irq_exits }, 64 { "irq_exits", &kvm_stat.irq_exits },
65 { 0, 0 } 65 { NULL, NULL }
66}; 66};
67 67
68static struct dentry *debugfs_dir; 68static struct dentry *debugfs_dir;
@@ -205,7 +205,7 @@ static struct kvm_vcpu *vcpu_load(struct kvm *kvm, int vcpu_slot)
205 mutex_lock(&vcpu->mutex); 205 mutex_lock(&vcpu->mutex);
206 if (unlikely(!vcpu->vmcs)) { 206 if (unlikely(!vcpu->vmcs)) {
207 mutex_unlock(&vcpu->mutex); 207 mutex_unlock(&vcpu->mutex);
208 return 0; 208 return NULL;
209 } 209 }
210 return kvm_arch_ops->vcpu_load(vcpu); 210 return kvm_arch_ops->vcpu_load(vcpu);
211} 211}
@@ -257,9 +257,9 @@ static void kvm_free_physmem_slot(struct kvm_memory_slot *free,
257 if (!dont || free->dirty_bitmap != dont->dirty_bitmap) 257 if (!dont || free->dirty_bitmap != dont->dirty_bitmap)
258 vfree(free->dirty_bitmap); 258 vfree(free->dirty_bitmap);
259 259
260 free->phys_mem = 0; 260 free->phys_mem = NULL;
261 free->npages = 0; 261 free->npages = 0;
262 free->dirty_bitmap = 0; 262 free->dirty_bitmap = NULL;
263} 263}
264 264
265static void kvm_free_physmem(struct kvm *kvm) 265static void kvm_free_physmem(struct kvm *kvm)
@@ -267,7 +267,7 @@ static void kvm_free_physmem(struct kvm *kvm)
267 int i; 267 int i;
268 268
269 for (i = 0; i < kvm->nmemslots; ++i) 269 for (i = 0; i < kvm->nmemslots; ++i)
270 kvm_free_physmem_slot(&kvm->memslots[i], 0); 270 kvm_free_physmem_slot(&kvm->memslots[i], NULL);
271} 271}
272 272
273static void kvm_free_vcpu(struct kvm_vcpu *vcpu) 273static void kvm_free_vcpu(struct kvm_vcpu *vcpu)
@@ -640,11 +640,11 @@ raced:
640 640
641 /* Deallocate if slot is being removed */ 641 /* Deallocate if slot is being removed */
642 if (!npages) 642 if (!npages)
643 new.phys_mem = 0; 643 new.phys_mem = NULL;
644 644
645 /* Free page dirty bitmap if unneeded */ 645 /* Free page dirty bitmap if unneeded */
646 if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES)) 646 if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES))
647 new.dirty_bitmap = 0; 647 new.dirty_bitmap = NULL;
648 648
649 r = -ENOMEM; 649 r = -ENOMEM;
650 650
@@ -799,14 +799,14 @@ struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn)
799 && gfn < memslot->base_gfn + memslot->npages) 799 && gfn < memslot->base_gfn + memslot->npages)
800 return memslot; 800 return memslot;
801 } 801 }
802 return 0; 802 return NULL;
803} 803}
804EXPORT_SYMBOL_GPL(gfn_to_memslot); 804EXPORT_SYMBOL_GPL(gfn_to_memslot);
805 805
806void mark_page_dirty(struct kvm *kvm, gfn_t gfn) 806void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
807{ 807{
808 int i; 808 int i;
809 struct kvm_memory_slot *memslot = 0; 809 struct kvm_memory_slot *memslot = NULL;
810 unsigned long rel_gfn; 810 unsigned long rel_gfn;
811 811
812 for (i = 0; i < kvm->nmemslots; ++i) { 812 for (i = 0; i < kvm->nmemslots; ++i) {
@@ -2015,7 +2015,7 @@ static int kvm_reboot(struct notifier_block *notifier, unsigned long val,
2015 * in vmx root mode. 2015 * in vmx root mode.
2016 */ 2016 */
2017 printk(KERN_INFO "kvm: exiting hardware virtualization\n"); 2017 printk(KERN_INFO "kvm: exiting hardware virtualization\n");
2018 on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); 2018 on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
2019 } 2019 }
2020 return NOTIFY_OK; 2020 return NOTIFY_OK;
2021} 2021}
@@ -2029,7 +2029,7 @@ static __init void kvm_init_debug(void)
2029{ 2029{
2030 struct kvm_stats_debugfs_item *p; 2030 struct kvm_stats_debugfs_item *p;
2031 2031
2032 debugfs_dir = debugfs_create_dir("kvm", 0); 2032 debugfs_dir = debugfs_create_dir("kvm", NULL);
2033 for (p = debugfs_entries; p->name; ++p) 2033 for (p = debugfs_entries; p->name; ++p)
2034 p->dentry = debugfs_create_u32(p->name, 0444, debugfs_dir, 2034 p->dentry = debugfs_create_u32(p->name, 0444, debugfs_dir,
2035 p->data); 2035 p->data);
@@ -2070,7 +2070,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
2070 if (r < 0) 2070 if (r < 0)
2071 return r; 2071 return r;
2072 2072
2073 on_each_cpu(kvm_arch_ops->hardware_enable, 0, 0, 1); 2073 on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1);
2074 register_reboot_notifier(&kvm_reboot_notifier); 2074 register_reboot_notifier(&kvm_reboot_notifier);
2075 2075
2076 kvm_chardev_ops.owner = module; 2076 kvm_chardev_ops.owner = module;
@@ -2085,7 +2085,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
2085 2085
2086out_free: 2086out_free:
2087 unregister_reboot_notifier(&kvm_reboot_notifier); 2087 unregister_reboot_notifier(&kvm_reboot_notifier);
2088 on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); 2088 on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
2089 kvm_arch_ops->hardware_unsetup(); 2089 kvm_arch_ops->hardware_unsetup();
2090 return r; 2090 return r;
2091} 2091}
@@ -2095,7 +2095,7 @@ void kvm_exit_arch(void)
2095 misc_deregister(&kvm_dev); 2095 misc_deregister(&kvm_dev);
2096 2096
2097 unregister_reboot_notifier(&kvm_reboot_notifier); 2097 unregister_reboot_notifier(&kvm_reboot_notifier);
2098 on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); 2098 on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
2099 kvm_arch_ops->hardware_unsetup(); 2099 kvm_arch_ops->hardware_unsetup();
2100 kvm_arch_ops = NULL; 2100 kvm_arch_ops = NULL;
2101} 2101}
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index c79df79307ed..85f61dd1e936 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -274,7 +274,7 @@ static void svm_hardware_disable(void *garbage)
274 wrmsrl(MSR_VM_HSAVE_PA, 0); 274 wrmsrl(MSR_VM_HSAVE_PA, 0);
275 rdmsrl(MSR_EFER, efer); 275 rdmsrl(MSR_EFER, efer);
276 wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); 276 wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
277 per_cpu(svm_data, raw_smp_processor_id()) = 0; 277 per_cpu(svm_data, raw_smp_processor_id()) = NULL;
278 __free_page(svm_data->save_area); 278 __free_page(svm_data->save_area);
279 kfree(svm_data); 279 kfree(svm_data);
280 } 280 }
@@ -642,7 +642,7 @@ static struct vmcb_seg *svm_seg(struct kvm_vcpu *vcpu, int seg)
642 case VCPU_SREG_LDTR: return &save->ldtr; 642 case VCPU_SREG_LDTR: return &save->ldtr;
643 } 643 }
644 BUG(); 644 BUG();
645 return 0; 645 return NULL;
646} 646}
647 647
648static u64 svm_get_segment_base(struct kvm_vcpu *vcpu, int seg) 648static u64 svm_get_segment_base(struct kvm_vcpu *vcpu, int seg)
@@ -934,7 +934,7 @@ static int io_get_override(struct kvm_vcpu *vcpu,
934 return 0; 934 return 0;
935 935
936 *addr_override = 0; 936 *addr_override = 0;
937 *seg = 0; 937 *seg = NULL;
938 for (i = 0; i < ins_length; i++) 938 for (i = 0; i < ins_length; i++)
939 switch (inst[i]) { 939 switch (inst[i]) {
940 case 0xf0: 940 case 0xf0:
@@ -1087,7 +1087,7 @@ static int cpuid_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1087 1087
1088static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 1088static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1089{ 1089{
1090 if (emulate_instruction(vcpu, 0, 0, 0) != EMULATE_DONE) 1090 if (emulate_instruction(vcpu, NULL, 0, 0) != EMULATE_DONE)
1091 printk(KERN_ERR "%s: failed\n", __FUNCTION__); 1091 printk(KERN_ERR "%s: failed\n", __FUNCTION__);
1092 return 1; 1092 return 1;
1093} 1093}
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 54c35c0b3181..27e05a77e21a 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -98,7 +98,7 @@ static struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr)
98 for (i = 0; i < vcpu->nmsrs; ++i) 98 for (i = 0; i < vcpu->nmsrs; ++i)
99 if (vcpu->guest_msrs[i].index == msr) 99 if (vcpu->guest_msrs[i].index == msr)
100 return &vcpu->guest_msrs[i]; 100 return &vcpu->guest_msrs[i];
101 return 0; 101 return NULL;
102} 102}
103 103
104static void vmcs_clear(struct vmcs *vmcs) 104static void vmcs_clear(struct vmcs *vmcs)