qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 09/11] i386: avoid a write only variable


From: Blue Swirl
Subject: [Qemu-devel] [PATCH 09/11] i386: avoid a write only variable
Date: Wed, 6 Oct 2010 21:34:01 +0000

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 <address@hidden>
---
 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]