[PATCH]Replace 0 with NULL when returning a pointer

Previous thread: Re: 2.6.21-rc3-mm1 by Paul E. McKenney on Sunday, March 11, 2007 - 9:41 pm. (1 message)

Next thread: [PATCH]Replace 0 with NULL when returning a pointer by Cong WANG on Sunday, March 11, 2007 - 11:50 pm. (1 message)
From: Cong WANG
Date: Sunday, March 11, 2007 - 11:47 pm

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);
-

From: Avi Kivity
Date: Monday, March 12, 2007 - 5:16 am

These are already fixed in my repo.


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

-

Previous thread: Re: 2.6.21-rc3-mm1 by Paul E. McKenney on Sunday, March 11, 2007 - 9:41 pm. (1 message)

Next thread: [PATCH]Replace 0 with NULL when returning a pointer by Cong WANG on Sunday, March 11, 2007 - 11:50 pm. (1 message)