KVM: Remove ptr comparisons to 0
authorJoe Perches <joe@perches.com>
Tue, 13 Nov 2007 04:06:51 +0000 (20:06 -0800)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:53:03 +0000 (17:53 +0200)
Fix sparse warnings "Using plain integer as NULL pointer"

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm.h
drivers/kvm/kvm_main.c
drivers/kvm/svm.c

index e34e246eafec5e4454270554a040fb3bdd0f5ad5..c4ad66bb5e0883b42fda3079b6f03e6d0f4aed47 100644 (file)
@@ -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 {
index 3946025f3d37c60d431b7f822de78e9f8af2c833..7335435f528e37ddeb69c2ebbf002f93e0265e20 100644 (file)
@@ -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;
index 0ccbef18476af55ebbb3baac0e4cb706f289cf12..a1a7f39ff3f1eed86f9a0a9a0329984d863b0fb7 100644 (file)
@@ -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;
This page took 0.031368 seconds and 5 git commands to generate.