From: Joe Perches <joe@perches.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] - drivers/kvm/* - remove ptr comparisons to 0
Date: Mon, 12 Nov 2007 20:06:51 -0800 [thread overview]
Message-ID: <1194926811.9407.61.camel@localhost> (raw)
fix sparse warnings "Using plain integer as NULL pointer"
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/kvm/kvm.h | 2 +-
drivers/kvm/kvm_main.c | 3 ++-
drivers/kvm/lapic.c | 2 +-
drivers/kvm/svm.c | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 3b0bc4b..f572a81 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -433,7 +433,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 07ae280..e06beaf 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -3535,7 +3535,8 @@ int kvm_init_x86(struct kvm_x86_ops *ops, 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/lapic.c b/drivers/kvm/lapic.c
index 238fcad..274b07e 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -771,7 +771,7 @@ void kvm_free_apic(struct kvm_lapic *apic)
if (apic->regs_page) {
__free_page(apic->regs_page);
- apic->regs_page = 0;
+ apic->regs_page = NULL;
}
kfree(apic);
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 729f1cd..6c7c797 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1282,7 +1282,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;
WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-kernel
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] - drivers/kvm/* - remove ptr comparisons to 0
Date: Mon, 12 Nov 2007 20:06:51 -0800 [thread overview]
Message-ID: <1194926811.9407.61.camel@localhost> (raw)
fix sparse warnings "Using plain integer as NULL pointer"
Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
drivers/kvm/kvm.h | 2 +-
drivers/kvm/kvm_main.c | 3 ++-
drivers/kvm/lapic.c | 2 +-
drivers/kvm/svm.c | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 3b0bc4b..f572a81 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -433,7 +433,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 07ae280..e06beaf 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -3535,7 +3535,8 @@ int kvm_init_x86(struct kvm_x86_ops *ops, 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/lapic.c b/drivers/kvm/lapic.c
index 238fcad..274b07e 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -771,7 +771,7 @@ void kvm_free_apic(struct kvm_lapic *apic)
if (apic->regs_page) {
__free_page(apic->regs_page);
- apic->regs_page = 0;
+ apic->regs_page = NULL;
}
kfree(apic);
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 729f1cd..6c7c797 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1282,7 +1282,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 SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next reply other threads:[~2007-11-13 4:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 4:06 Joe Perches [this message]
2007-11-13 4:06 ` [PATCH] - drivers/kvm/* - remove ptr comparisons to 0 Joe Perches
2007-11-18 10:40 ` [kvm-devel] " Avi Kivity
2007-11-18 10:40 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1194926811.9407.61.camel@localhost \
--to=joe@perches.com \
--cc=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.