qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Cc: edgar.iglesias@axis.com
Subject: [Qemu-devel] [PATCH v2 5/7] clean build: Fix remaining cris warnings
Date: Sun, 22 Feb 2009 11:36:19 +0100	[thread overview]
Message-ID: <49A12AA3.1040505@web.de> (raw)
In-Reply-To: <761ea48b0902211513h12ddaf09x4dab923f8512a128@mail.gmail.com>

Laurent Desnogues wrote:
> On Sun, Feb 22, 2009 at 12:03 AM, Stuart Brady <sdbrady@ntlworld.com> wrote:
>> On Sat, Feb 21, 2009 at 08:00:55PM +0100, Jan Kiszka wrote:
>>> diff --git a/target-cris/translate.c b/target-cris/translate.c
>>> index f575e63..954b038 100644
>>> --- a/target-cris/translate.c
>>> +++ b/target-cris/translate.c
>>> @@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)
>>>  static unsigned int dec_movem_mr(DisasContext *dc)
>>>  {
>>>       TCGv_i64 tmp[16];
>>> -        TCGv tmp32;
>>> +        TCGv tmp32 = 0;
>>>       TCGv addr;
>>>       int i;
>>>       int nr = dc->op2 + 1;
>> Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful.
>> At the very least, shouldn't there be a comment?  Something like Linux's
>> uninitialized_var() macro might be worth considering...
> 
> Some targets use TCGV_UNUSED_I32/I64.  I would initialize tmp32
> to that value in an additional else part to the first if (nr & 1).  That
> should silence gcc.
> 

Good point, here is a fixed version according to your suggestion:

------------->

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 hw/etraxfs_eth.c        |    3 +--
 hw/etraxfs_ser.c        |    1 +
 hw/etraxfs_timer.c      |    1 +
 target-cris/cpu.h       |    3 +++
 target-cris/exec.h      |    3 ---
 target-cris/translate.c |    3 ++-
 6 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c
index 13d1900..c87e55f 100644
--- a/hw/etraxfs_eth.c
+++ b/hw/etraxfs_eth.c
@@ -25,8 +25,7 @@
 #include <stdio.h>
 #include "hw.h"
 #include "net.h"
-
-#include "etraxfs_dma.h"
+#include "etraxfs.h"
 
 #define D(x)
 
diff --git a/hw/etraxfs_ser.c b/hw/etraxfs_ser.c
index e32e2eb..8367386 100644
--- a/hw/etraxfs_ser.c
+++ b/hw/etraxfs_ser.c
@@ -26,6 +26,7 @@
 #include <ctype.h>
 #include "hw.h"
 #include "qemu-char.h"
+#include "etraxfs.h"
 
 #define D(x)
 
diff --git a/hw/etraxfs_timer.c b/hw/etraxfs_timer.c
index ebb06e1..1144369 100644
--- a/hw/etraxfs_timer.c
+++ b/hw/etraxfs_timer.c
@@ -26,6 +26,7 @@
 #include "hw.h"
 #include "sysemu.h"
 #include "qemu-timer.h"
+#include "etraxfs.h"
 
 #define D(x)
 
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index dea4cc4..754953c 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -216,6 +216,9 @@ static inline int cpu_mmu_index (CPUState *env)
 	return !!(env->pregs[PR_CCS] & U_FLAG);
 }
 
+int cpu_cris_handle_mmu_fault(CPUState *env, target_ulong address, int rw,
+                              int mmu_idx, int is_softmmu);
+
 #if defined(CONFIG_USER_ONLY)
 static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
 {
diff --git a/target-cris/exec.h b/target-cris/exec.h
index cce87f6..77e4240 100644
--- a/target-cris/exec.h
+++ b/target-cris/exec.h
@@ -33,9 +33,6 @@ static inline void regs_to_env(void)
 {
 }
 
-int cpu_cris_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
-                              int mmu_idx, int is_softmmu);
-
 #if !defined(CONFIG_USER_ONLY)
 #include "softmmu_exec.h"
 #endif
diff --git a/target-cris/translate.c b/target-cris/translate.c
index f575e63..d5fcb9e 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -2633,7 +2633,8 @@ static unsigned int dec_movem_mr(DisasContext *dc)
 		tmp32 = tcg_temp_new_i32();
 		tcg_gen_addi_tl(addr, cpu_R[dc->op1], i * 8);
 		gen_load(dc, tmp32, addr, 4, 0);
-	}
+	} else
+		TCGV_UNUSED(tmp32);
 	tcg_temp_free(addr);
 
 	for (i = 0; i < (nr >> 1); i++) {

  reply	other threads:[~2009-02-22 10:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-21 19:00 [Qemu-devel] [PATCH 0/7] clean build - eliminate warnings Jan Kiszka
2009-02-21 19:00 ` [Qemu-devel] [PATCH 2/7] clean build: Fix irq_info and pic_info related warnings Jan Kiszka
2009-02-21 19:00 ` [Qemu-devel] [PATCH 3/7] arm: Fix gic_irq_state.level bitfield type Jan Kiszka
2009-03-07 21:48   ` Aurelien Jarno
2009-02-21 19:00 ` [Qemu-devel] [PATCH 4/7] clean build: Fix arm build warnings Jan Kiszka
2009-03-07 21:48   ` Aurelien Jarno
2009-02-21 19:00 ` [Qemu-devel] [PATCH 1/7] clean build: Add bt_host_hci prototype Jan Kiszka
2009-03-08 14:56   ` [Qemu-devel] " Jan Kiszka
2009-03-08 18:44     ` Aurelien Jarno
2009-03-08 19:56       ` [Qemu-devel] [PATCH] clean build: Add bt-host.h Jan Kiszka
2009-03-10 21:43         ` Aurelien Jarno
2009-03-10 23:03         ` andrzej zaborowski
2009-03-11  9:02           ` [Qemu-devel] " Jan Kiszka
2009-03-20 14:51             ` andrzej zaborowski
2009-02-21 19:00 ` [Qemu-devel] [PATCH 5/7] clean build: Fix remaining cris warnings Jan Kiszka
2009-02-21 23:03   ` Stuart Brady
2009-02-21 23:12     ` Stuart Brady
2009-02-21 23:13     ` Laurent Desnogues
2009-02-22 10:36       ` Jan Kiszka [this message]
2009-02-22 14:14         ` [Qemu-devel] [PATCH v2 " Edgar E. Iglesias
2009-02-21 23:14     ` [Qemu-devel] [PATCH " Paul Brook
2009-02-21 19:00 ` [Qemu-devel] [PATCH 6/7] clean build: Fix remaining m68k warnings Jan Kiszka
2009-03-07 21:48   ` Aurelien Jarno
2009-02-21 19:00 ` [Qemu-devel] [PATCH 7/7] clean build: Fix remaining sh4 warnings Jan Kiszka
2009-02-21 19:43 ` [Qemu-devel] [PATCH 0/7] clean build - eliminate warnings Laurent Desnogues
2009-02-21 20:09   ` [Qemu-devel] " Jan Kiszka
2009-02-21 23:08     ` Laurent Desnogues
2009-02-22 10:39       ` Jan Kiszka
2009-02-22 11:09         ` Jan Kiszka
2009-02-22  0:59     ` Edgar E. Iglesias
2009-02-22 10:20       ` Jan Kiszka

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=49A12AA3.1040505@web.de \
    --to=jan.kiszka@web.de \
    --cc=edgar.iglesias@axis.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).