Skip to contentSkip to conversation

KVM: PPC: fix build error for un-initialised var

PATCH In review Bruce Majia 2 participants 2 messages Mar 26, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: fix build error for un-initialised var

Quoted 1 line

From 28eda49102f6886110376efbff318f1814686945 Mon Sep 17 00:00:00 2001

From: Bruce Majia <[email protected]>
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.

---
 arch/powerpc/kvm/booke.c   |    2 +-
 arch/powerpc/kvm/powerpc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kvm/booke.c +1 -1
index 4d686cc..0cde83b 100644
@@ -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) {
arch/powerpc/kvm/powerpc.c +1 -1
index 51aedd7..372b678 100644
@@ -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);
Signature · 1 line
1.6.6
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Bruce Majia

From 28eda49102f6886110376efbff318f1814686945 Mon Sep 17 00:00:00 2001
From: Bruce Majia <[email protected]>
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.

Please also queue for 2.6.34.

Alex