LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kvm: sparse fixes for kvm/x86.c
@ 2008-02-19 18:25 Harvey Harrison
  2008-02-21  9:02 ` [kvm-devel] " Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Harvey Harrison @ 2008-02-19 18:25 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Ingo Molnar, LKML, kvm-devel

In two case statements, use the ever popular 'i' instead of index:
arch/x86/kvm/x86.c:1063:7: warning: symbol 'index' shadows an earlier one
arch/x86/kvm/x86.c:1000:9: originally declared here
arch/x86/kvm/x86.c:1079:7: warning: symbol 'index' shadows an earlier one
arch/x86/kvm/x86.c:1000:9: originally declared here

Missing semicolon.
arch/x86/kvm/x86.c:493:3: warning: returning void-valued expression

Make it static.
arch/x86/kvm/x86.c:1945:24: warning: symbol 'emulate_ops' was not declared. Should it be static?

Drop the return statements.
arch/x86/kvm/x86.c:2878:2: warning: returning void-valued expression
arch/x86/kvm/x86.c:2944:2: warning: returning void-valued expression

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
Ingo, I had originally sent this to you, please drop it if you haven't already
done so, I'll get this in through the kvm tree.

 arch/x86/kvm/x86.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5dfc21f..df49ddc 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -490,7 +490,7 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
 	struct timespec wc_ts;
 
 	if (!wall_clock)
-		return
+		return;
 
 	mutex_lock(&kvm->lock);
 
@@ -1060,32 +1060,32 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 	}
 	/* function 4 and 0xb have additional index. */
 	case 4: {
-		int index, cache_type;
+		int i, cache_type;
 
 		entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
 		/* read more entries until cache_type is zero */
-		for (index = 1; *nent < maxnent; ++index) {
-			cache_type = entry[index - 1].eax & 0x1f;
+		for (i = 1; *nent < maxnent; ++i) {
+			cache_type = entry[i - 1].eax & 0x1f;
 			if (!cache_type)
 				break;
-			do_cpuid_1_ent(&entry[index], function, index);
-			entry[index].flags |=
+			do_cpuid_1_ent(&entry[i], function, i);
+			entry[i].flags |=
 			       KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
 			++*nent;
 		}
 		break;
 	}
 	case 0xb: {
-		int index, level_type;
+		int i, level_type;
 
 		entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
 		/* read more entries until level_type is zero */
-		for (index = 1; *nent < maxnent; ++index) {
-			level_type = entry[index - 1].ecx & 0xff;
+		for (i = 1; *nent < maxnent; ++i) {
+			level_type = entry[i - 1].ecx & 0xff;
 			if (!level_type)
 				break;
-			do_cpuid_1_ent(&entry[index], function, index);
-			entry[index].flags |=
+			do_cpuid_1_ent(&entry[i], function, i);
+			entry[i].flags |=
 			       KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
 			++*nent;
 		}
@@ -1942,7 +1942,7 @@ void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context)
 }
 EXPORT_SYMBOL_GPL(kvm_report_emulation_failure);
 
-struct x86_emulate_ops emulate_ops = {
+static struct x86_emulate_ops emulate_ops = {
 	.read_std            = emulator_read_std,
 	.read_emulated       = emulator_read_emulated,
 	.write_emulated      = emulator_write_emulated,
@@ -2875,7 +2875,7 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
 static void get_segment(struct kvm_vcpu *vcpu,
 			struct kvm_segment *var, int seg)
 {
-	return kvm_x86_ops->get_segment(vcpu, var, seg);
+	kvm_x86_ops->get_segment(vcpu, var, seg);
 }
 
 void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
@@ -2941,7 +2941,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
 static void set_segment(struct kvm_vcpu *vcpu,
 			struct kvm_segment *var, int seg)
 {
-	return kvm_x86_ops->set_segment(vcpu, var, seg);
+	kvm_x86_ops->set_segment(vcpu, var, seg);
 }
 
 int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
-- 
1.5.4.2.200.g99e75




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

* Re: [kvm-devel] [PATCH] kvm: sparse fixes for kvm/x86.c
  2008-02-19 18:25 [PATCH] kvm: sparse fixes for kvm/x86.c Harvey Harrison
@ 2008-02-21  9:02 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-02-21  9:02 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: kvm-devel, LKML

Harvey Harrison wrote:
> In two case statements, use the ever popular 'i' instead of index:
> arch/x86/kvm/x86.c:1063:7: warning: symbol 'index' shadows an earlier one
> arch/x86/kvm/x86.c:1000:9: originally declared here
> arch/x86/kvm/x86.c:1079:7: warning: symbol 'index' shadows an earlier one
> arch/x86/kvm/x86.c:1000:9: originally declared here
>
> Missing semicolon.
> arch/x86/kvm/x86.c:493:3: warning: returning void-valued expression
>
> Make it static.
> arch/x86/kvm/x86.c:1945:24: warning: symbol 'emulate_ops' was not declared. Should it be static?
>
> Drop the return statements.
> arch/x86/kvm/x86.c:2878:2: warning: returning void-valued expression
> arch/x86/kvm/x86.c:2944:2: warning: returning void-valued expression
>   

Applied all three patches, thanks.

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


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

end of thread, other threads:[~2008-02-21  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-19 18:25 [PATCH] kvm: sparse fixes for kvm/x86.c Harvey Harrison
2008-02-21  9:02 ` [kvm-devel] " Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).