qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 09/11] i386: avoid a write only variable
@ 2010-10-06 21:34 Blue Swirl
  2010-10-07  7:27 ` [Qemu-devel] " Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Blue Swirl @ 2010-10-06 21:34 UTC (permalink / raw)
  To: qemu-devel

Compiling with GCC 4.6.0 20100925 produced warnings:
/src/qemu/target-i386/op_helper.c: In function 'switch_tss':
/src/qemu/target-i386/op_helper.c:283:53: error: variable 'new_trap'
set but not used [-Werror=unused-but-set-variable]

Fix by deleting the variable.

Alternatively the flag could be implemented by generating a debug
exception if the flag is set.

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

diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index ec6b3e9..a5462a9 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -280,7 +280,7 @@ static void switch_tss(int tss_selector,
     int tss_limit, tss_limit_max, type, old_tss_limit_max, old_type, v1, v2, i;
     target_ulong tss_base;
     uint32_t new_regs[8], new_segs[6];
-    uint32_t new_eflags, new_eip, new_cr3, new_ldt, new_trap;
+    uint32_t new_eflags, new_eip, new_cr3, new_ldt;
     uint32_t old_eflags, eflags_mask;
     SegmentCache *dt;
     int index;
@@ -334,7 +334,6 @@ static void switch_tss(int tss_selector,
         for(i = 0; i < 6; i++)
             new_segs[i] = lduw_kernel(tss_base + (0x48 + i * 4));
         new_ldt = lduw_kernel(tss_base + 0x60);
-        new_trap = ldl_kernel(tss_base + 0x64);
     } else {
         /* 16 bit */
         new_cr3 = 0;
@@ -347,7 +346,6 @@ static void switch_tss(int tss_selector,
         new_ldt = lduw_kernel(tss_base + 0x2a);
         new_segs[R_FS] = 0;
         new_segs[R_GS] = 0;
-        new_trap = 0;
     }

     /* NOTE: we must avoid memory exceptions during the task switch,
-- 
1.6.2.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-07 17:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 21:34 [Qemu-devel] [PATCH 09/11] i386: avoid a write only variable Blue Swirl
2010-10-07  7:27 ` [Qemu-devel] " Paolo Bonzini
2010-10-07  8:27   ` malc
2010-10-07 17:36     ` Blue Swirl
2010-10-07 17:44       ` malc
2010-10-07 17:32   ` Blue Swirl

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).