From: Joe Perches Date: Tue, 13 Nov 2007 04:06:51 +0000 (-0800) Subject: KVM: Remove ptr comparisons to 0 X-Git-Tag: v2.6.25-rc1~1138^2~143 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56919c5c97aa07b150311c5c9802af07872ee2b0;p=linux-2.6 KVM: Remove ptr comparisons to 0 Fix sparse warnings "Using plain integer as NULL pointer" Signed-off-by: Joe Perches Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index e34e246eaf..c4ad66bb5e 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -398,7 +398,7 @@ static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm) static inline int irqchip_in_kernel(struct kvm *kvm) { - return pic_irqchip(kvm) != 0; + return pic_irqchip(kvm) != NULL; } struct descriptor_table { diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 3946025f3d..7335435f52 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -1449,7 +1449,8 @@ int kvm_init(void *opaque, unsigned int vcpu_size, /* A kmem cache lets us meet the alignment requirements of fx_save. */ kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, - __alignof__(struct kvm_vcpu), 0, 0); + __alignof__(struct kvm_vcpu), + 0, NULL); if (!kvm_vcpu_cache) { r = -ENOMEM; goto out_free_4; diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 0ccbef1847..a1a7f39ff3 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -1271,7 +1271,7 @@ static int handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) exit_code); if (exit_code >= ARRAY_SIZE(svm_exit_handlers) - || svm_exit_handlers[exit_code] == 0) { + || !svm_exit_handlers[exit_code]) { kvm_run->exit_reason = KVM_EXIT_UNKNOWN; kvm_run->hw.hardware_exit_reason = exit_code; return 0;