diff options
author | Joe Perches <joe@perches.com> | 2007-11-12 23:06:51 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:03 -0500 |
commit | 56919c5c97aa07b150311c5c9802af07872ee2b0 (patch) | |
tree | 287456543e7f6678c06af77eb0344a615c6e0b97 | |
parent | 8b0067913d9d0439d4cf3c1f7314ba71fc7b2958 (diff) |
KVM: Remove ptr comparisons to 0
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>
-rw-r--r-- | drivers/kvm/kvm.h | 2 | ||||
-rw-r--r-- | drivers/kvm/kvm_main.c | 3 | ||||
-rw-r--r-- | drivers/kvm/svm.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index e34e246eafec..c4ad66bb5e08 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) | |||
398 | 398 | ||
399 | static inline int irqchip_in_kernel(struct kvm *kvm) | 399 | static inline int irqchip_in_kernel(struct kvm *kvm) |
400 | { | 400 | { |
401 | return pic_irqchip(kvm) != 0; | 401 | return pic_irqchip(kvm) != NULL; |
402 | } | 402 | } |
403 | 403 | ||
404 | struct descriptor_table { | 404 | struct descriptor_table { |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 3946025f3d37..7335435f528e 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, | |||
1449 | 1449 | ||
1450 | /* A kmem cache lets us meet the alignment requirements of fx_save. */ | 1450 | /* A kmem cache lets us meet the alignment requirements of fx_save. */ |
1451 | kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, | 1451 | kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, |
1452 | __alignof__(struct kvm_vcpu), 0, 0); | 1452 | __alignof__(struct kvm_vcpu), |
1453 | 0, NULL); | ||
1453 | if (!kvm_vcpu_cache) { | 1454 | if (!kvm_vcpu_cache) { |
1454 | r = -ENOMEM; | 1455 | r = -ENOMEM; |
1455 | goto out_free_4; | 1456 | goto out_free_4; |
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 0ccbef18476a..a1a7f39ff3f1 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) | |||
1271 | exit_code); | 1271 | exit_code); |
1272 | 1272 | ||
1273 | if (exit_code >= ARRAY_SIZE(svm_exit_handlers) | 1273 | if (exit_code >= ARRAY_SIZE(svm_exit_handlers) |
1274 | || svm_exit_handlers[exit_code] == 0) { | 1274 | || !svm_exit_handlers[exit_code]) { |
1275 | kvm_run->exit_reason = KVM_EXIT_UNKNOWN; | 1275 | kvm_run->exit_reason = KVM_EXIT_UNKNOWN; |
1276 | kvm_run->hw.hardware_exit_reason = exit_code; | 1276 | kvm_run->hw.hardware_exit_reason = exit_code; |
1277 | return 0; | 1277 | return 0; |