From patchwork Fri Oct 8 21:25:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 67301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EDA34B70D6 for ; Sat, 9 Oct 2010 08:42:43 +1100 (EST) Received: from localhost ([127.0.0.1]:50688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4Ki8-0007ga-CN for incoming@patchwork.ozlabs.org; Fri, 08 Oct 2010 17:42:40 -0400 Received: from [140.186.70.92] (port=51333 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4KRs-0004qj-GR for qemu-devel@nongnu.org; Fri, 08 Oct 2010 17:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4KRr-0001dF-8q for qemu-devel@nongnu.org; Fri, 08 Oct 2010 17:25:52 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:48826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4KRq-0001dA-VH for qemu-devel@nongnu.org; Fri, 08 Oct 2010 17:25:51 -0400 Received: by qyk8 with SMTP id 8so469147qyk.4 for ; Fri, 08 Oct 2010 14:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=rPHrmloyXcfK8BwtTNK+ZyETKI0qofwgsKpCE8P4fyo=; b=ceEo8bvrNh40G/OuHRnj8K+EZ1PFwQgQs5JX+rxfx0V+J1YXLrNjh00WBxWCkJFaps +/evxopI5SD+teBHetbXulyASYku/hfL8UctHFDkUnRRS8tn7I6BRHOFW+MiGt/yn3w9 MQ84smxTD9r7Byb3apxIrh/mfnDVLYyLZaF44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=A4ld6N8nMZk64lYX2apdDiuLvp5+LdyD7l07R0KiT9+FfqKSbITVpN6lKVS0J9hXLD LUK789L9LAkxWsxTb8CDxt0etadia5fJ3iGdFLuDxI1kaLq9BoSkYrFrvgMDEtBEvNvL Y0MFYBXMDrXvvy1BII3LOaHZ+GL3/vxugS+fo= Received: by 10.224.213.9 with SMTP id gu9mr1995380qab.271.1286573150543; Fri, 08 Oct 2010 14:25:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.31.139 with HTTP; Fri, 8 Oct 2010 14:25:30 -0700 (PDT) From: Blue Swirl Date: Fri, 8 Oct 2010 21:25:30 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 10/12] i386: avoid a write only variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 adding a dummy cast so that the variable is not unused. Add also pointer to docs. Signed-off-by: Blue Swirl --- target-i386/op_helper.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c index ec6b3e9..43fbd0c 100644 --- a/target-i386/op_helper.c +++ b/target-i386/op_helper.c @@ -349,6 +349,10 @@ static void switch_tss(int tss_selector, new_segs[R_GS] = 0; new_trap = 0; } + /* XXX: avoid a compiler warning, see + http://support.amd.com/us/Processor_TechDocs/24593.pdf + chapters 12.2.5 and 13.2.4 on how to implement TSS Trap bit */ + (void)new_trap; /* NOTE: we must avoid memory exceptions during the task switch, so we make dummy accesses before */