diff mbox

[09/20] ppc: avoid a warning with the next patch

Message ID CAAu8pHtJxztaPnRtgaSbd9Hk9yhpjyQQtnTczcT0tRKcKniCNQ@mail.gmail.com
State New
Headers show

Commit Message

Blue Swirl March 31, 2012, 4:29 p.m. UTC
When the code is moved together by the next patch, compiler
detects a possible uninitialized variable use. Avoid the warning
by initializing the variables.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 target-ppc/mmu_helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

         helper_raise_exception_err(POWERPC_EXCP_PROGRAM, POWERPC_EXCP_INVAL);
@@ -98,7 +98,7 @@ target_ulong helper_load_slb_esid(CPUPPCState *env,
target_ulong rb)

 target_ulong helper_load_slb_vsid(CPUPPCState *env, target_ulong rb)
 {
-    target_ulong rt;
+    target_ulong rt = 0;

     if (ppc_load_slb_vsid(env, rb, &rt) < 0) {
         helper_raise_exception_err(POWERPC_EXCP_PROGRAM, POWERPC_EXCP_INVAL);
diff mbox

Patch

From 485bee88416affc711d33520c0087f6530cb26d7 Mon Sep 17 00:00:00 2001
Message-Id: <485bee88416affc711d33520c0087f6530cb26d7.1333209986.git.blauwirbel@gmail.com>
In-Reply-To: <34503fca1f76589818c4ee0ce465269fbd75fba5.1333209986.git.blauwirbel@gmail.com>
References: <34503fca1f76589818c4ee0ce465269fbd75fba5.1333209986.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sun, 25 Mar 2012 14:48:20 +0000
Subject: [PATCH 09/20] ppc: avoid a warning with the next patch

When the code is moved together by the next patch, compiler
detects a possible uninitialized variable use. Avoid the warning
by initializing the variables.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 target-ppc/mmu_helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
index 22a6ffd..eaad25b 100644
--- a/target-ppc/mmu_helper.c
+++ b/target-ppc/mmu_helper.c
@@ -88,7 +88,7 @@  void helper_store_slb(CPUPPCState *env, target_ulong rb, target_ulong rs)
 
 target_ulong helper_load_slb_esid(CPUPPCState *env, target_ulong rb)
 {
-    target_ulong rt;
+    target_ulong rt = 0;
 
     if (ppc_load_slb_esid(env, rb, &rt) < 0) {
         helper_raise_exception_err(POWERPC_EXCP_PROGRAM, POWERPC_EXCP_INVAL);
@@ -98,7 +98,7 @@  target_ulong helper_load_slb_esid(CPUPPCState *env, target_ulong rb)
 
 target_ulong helper_load_slb_vsid(CPUPPCState *env, target_ulong rb)
 {
-    target_ulong rt;
+    target_ulong rt = 0;
 
     if (ppc_load_slb_vsid(env, rb, &rt) < 0) {
         helper_raise_exception_err(POWERPC_EXCP_PROGRAM, POWERPC_EXCP_INVAL);
-- 
1.7.2.5