public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Bruce Majia <bruce.majia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: agraf-l3A5Bk7waGM@public.gmane.org,
	kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] KVM: PPC: fix build error for un-initialised var
Date: Fri, 26 Mar 2010 19:28:20 +0800	[thread overview]
Message-ID: <20100326112820.GB14003@localhost> (raw)

>From 28eda49102f6886110376efbff318f1814686945 Mon Sep 17 00:00:00 2001
From: Bruce Majia <bruce.majia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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

             reply	other threads:[~2010-03-26 11:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 11:28 Bruce Majia [this message]
2010-03-26 11:32 ` [PATCH] KVM: PPC: fix build error for un-initialised var Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100326112820.GB14003@localhost \
    --to=bruce.majia-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=agraf-l3A5Bk7waGM@public.gmane.org \
    --cc=kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox