public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]Replace 0 with NULL when returning a pointer
@ 2007-03-12  6:47 Cong WANG
  2007-03-12 12:16 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Cong WANG @ 2007-03-12  6:47 UTC (permalink / raw)
  To: linux-kernel, avi

Use NULL to indicate we are returning a pointer rather than an integer
and to eliminate some sparse warnings.

Signed-off-by: Cong WANG <xiyou.wangcong@gmail.com>

---
--- drivers/kvm/kvm_main.c.orig	2007-03-11 21:41:23.000000000 +0800
+++ drivers/kvm/kvm_main.c	2007-03-12 14:26:17.000000000 +0800
@@ -205,7 +205,7 @@ static struct kvm_vcpu *vcpu_load(struct
 	mutex_lock(&vcpu->mutex);
 	if (unlikely(!vcpu->vmcs)) {
 		mutex_unlock(&vcpu->mutex);
-		return 0;
+		return NULL;
 	}
 	return kvm_arch_ops->vcpu_load(vcpu);
 }
@@ -799,7 +799,7 @@ struct kvm_memory_slot *gfn_to_memslot(s
 		    && gfn < memslot->base_gfn + memslot->npages)
 			return memslot;
 	}
-	return 0;
+	return NULL;
 }
 EXPORT_SYMBOL_GPL(gfn_to_memslot);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH]Replace 0 with NULL when returning a pointer
@ 2007-03-12  6:50 Cong WANG
  0 siblings, 0 replies; 3+ messages in thread
From: Cong WANG @ 2007-03-12  6:50 UTC (permalink / raw)
  To: linux-kernel, avi

Use NULL to indicate we are returning a pointer rather than an integer
and to eliminate some sparse warnings.

Signed-off-by: Cong WANG <xiyou.wangcong@gmail.com>
---
--- drivers/kvm/vmx.c.orig	2007-03-11 21:41:03.000000000 +0800
+++ drivers/kvm/vmx.c	2007-03-12 14:25:11.000000000 +0800
@@ -98,7 +98,7 @@ static struct vmx_msr_entry *find_msr_en
 	for (i = 0; i < vcpu->nmsrs; ++i)
 		if (vcpu->guest_msrs[i].index == msr)
 			return &vcpu->guest_msrs[i];
-	return 0;
+	return NULL;
 }

 static void vmcs_clear(struct vmcs *vmcs)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]Replace 0 with NULL when returning a pointer
  2007-03-12  6:47 [PATCH]Replace 0 with NULL when returning a pointer Cong WANG
@ 2007-03-12 12:16 ` Avi Kivity
  0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2007-03-12 12:16 UTC (permalink / raw)
  To: Cong WANG; +Cc: linux-kernel

Cong WANG wrote:
> Use NULL to indicate we are returning a pointer rather than an integer
> and to eliminate some sparse warnings.
>
> Signed-off-by: Cong WANG <xiyou.wangcong@gmail.com>

These are already fixed in my repo.


-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-12 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-12  6:47 [PATCH]Replace 0 with NULL when returning a pointer Cong WANG
2007-03-12 12:16 ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2007-03-12  6:50 Cong WANG

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox