[PATCH] KVM: PPC: fix build error for un-initialised var

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 28eda49102f6886110376efbff318f1814686945 Mon Sep 17 00:00:00 2001
From: Bruce Majia <bruce.majia@xxxxxxxxx>
Date: Fri, 26 Mar 2010 19:23:33 +0800
Subject: [PATCH] KVM: PPC: fix build error for un-initialised var

The '-Werror' option for cc makes compiler to distinguish warnings as
errors. So un-initialised variables should be eliminated to avoid build
errors.

Signed-off-by: Bruce Majia <bruce.majia@xxxxxxxxx>
---
 arch/powerpc/kvm/booke.c   |    2 +-
 arch/powerpc/kvm/powerpc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 4d686cc..0cde83b 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -137,7 +137,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
                                         unsigned int priority)
 {
 	int allowed = 0;
-	ulong msr_mask;
+	ulong msr_mask = 0;
 	bool update_esr = false, update_dear = false;
 
 	switch (priority) {
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 51aedd7..372b678 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -277,7 +277,7 @@ static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,
 static void kvmppc_complete_mmio_load(struct kvm_vcpu *vcpu,
                                       struct kvm_run *run)
 {
-	ulong gpr;
+	ulong gpr = 0;
 
 	if (run->mmio.len > sizeof(gpr)) {
 		printk(KERN_ERR "bad MMIO length: %d\n", run->mmio.len);
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux