From patchwork Fri Oct 8 21:25:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 67294 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 13FD4B70A9 for ; Sat, 9 Oct 2010 08:30:19 +1100 (EST) Received: from localhost ([127.0.0.1]:58464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4KW8-0007IS-Fj for incoming@patchwork.ozlabs.org; Fri, 08 Oct 2010 17:30:16 -0400 Received: from [140.186.70.92] (port=51397 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4KSD-000523-RA for qemu-devel@nongnu.org; Fri, 08 Oct 2010 17:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4KSC-0001k6-C6 for qemu-devel@nongnu.org; Fri, 08 Oct 2010 17:26:13 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:54325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4KSC-0001k1-6O for qemu-devel@nongnu.org; Fri, 08 Oct 2010 17:26:12 -0400 Received: by qwk4 with SMTP id 4so1031581qwk.4 for ; Fri, 08 Oct 2010 14:26:11 -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=JFS5yd57jzvbchUdP3VG7kcHhpF/bNfrca1SjJx5ufo=; b=PgsDf7KSbXmV2ImKkHwS7aYQcFLP46YDPFwVz8NRLt1riXtnDeAMgRVJOKriLU0jTD /NcdiY1Qwat+Jfy86anhMsQnLpcv2LTkdQfI3ifJuQR1IDncJYdSKh/g54sErlPmDOrL OysjS7vBMIFoT7q0pgb/tLMozrc/WwU/2O72U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=IRzqAQlmecbhQjyunq9uFSvl4piowGhFcVz1eTW0/XlOf3TzXeQCTeTn/99iRqYxZO 3d5DNEJqtPIbcLq1bKBKePstqmeeWhiyhVTvayydQGlB3wUtNaCGOf67SKv6rgwFfB4l FNvQQLxbdaILs83kw19vup2d9Fcyl/Z6tT+pU= Received: by 10.229.182.205 with SMTP id cd13mr2503383qcb.30.1286573171793; Fri, 08 Oct 2010 14:26:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.31.139 with HTTP; Fri, 8 Oct 2010 14:25:51 -0700 (PDT) From: Blue Swirl Date: Fri, 8 Oct 2010 21:25:51 +0000 Message-ID: To: qemu-devel , Alexander Graf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: [Qemu-devel] [PATCH 11/12] ppc: avoid write only variables 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-ppc/op_helper.c: In function 'helper_icbi': /src/qemu/target-ppc/op_helper.c:351:14: error: variable 'tmp' set but not used [-Werror=unused-but-set-variable] /src/qemu/target-ppc/op_helper.c: In function 'do_6xx_tlb': /src/qemu/target-ppc/op_helper.c:3805:28: error: variable 'EPN' set but not used [-Werror=unused-but-set-variable] /src/qemu/target-ppc/op_helper.c: In function 'do_74xx_tlb': /src/qemu/target-ppc/op_helper.c:3838:28: error: variable 'EPN' set but not used [-Werror=unused-but-set-variable] Fix by adding a dummy cast so that the variable is not unused. Delete tmp. Signed-off-by: Blue Swirl --- target-ppc/op_helper.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 45f1655..13502ae 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -348,15 +348,13 @@ void helper_dcbz_970(target_ulong addr) void helper_icbi(target_ulong addr) { - uint32_t tmp; - addr &= ~(env->dcache_line_size - 1); /* Invalidate one cache line : * PowerPC specification says this is to be treated like a load * (not a fetch) by the MMU. To be sure it will be so, * do the load "by hand". */ - tmp = ldl(addr); + ldl(addr); tb_invalidate_page_range(addr, addr + env->icache_line_size); } @@ -3802,7 +3800,8 @@ void helper_tlbie (target_ulong addr) /* PowerPC 602/603 software TLB load instructions helpers */ static void do_6xx_tlb (target_ulong new_EPN, int is_code) { - target_ulong RPN, CMP, EPN; + target_ulong RPN, CMP; + target_ulong EPN; int way; RPN = env->spr[SPR_RPA]; @@ -3814,6 +3813,7 @@ static void do_6xx_tlb (target_ulong new_EPN, int is_code) EPN = env->spr[SPR_DMISS]; } way = (env->spr[SPR_SRR1] >> 17) & 1; + (void)EPN; /* avoid a compiler warning */ LOG_SWTLB("%s: EPN " TARGET_FMT_lx " " TARGET_FMT_lx " PTE0 " TARGET_FMT_lx " PTE1 " TARGET_FMT_lx " way %d\n", __func__, new_EPN, EPN, CMP, RPN, way); @@ -3835,13 +3835,15 @@ void helper_6xx_tlbi (target_ulong EPN) /* PowerPC 74xx software TLB load instructions helpers */ static void do_74xx_tlb (target_ulong new_EPN, int is_code) { - target_ulong RPN, CMP, EPN; + target_ulong RPN, CMP; + target_ulong EPN; int way; RPN = env->spr[SPR_PTELO]; CMP = env->spr[SPR_PTEHI]; EPN = env->spr[SPR_TLBMISS] & ~0x3; way = env->spr[SPR_TLBMISS] & 0x3; + (void)EPN; /* avoid a compiler warning */ LOG_SWTLB("%s: EPN " TARGET_FMT_lx " " TARGET_FMT_lx " PTE0 " TARGET_FMT_lx " PTE1 " TARGET_FMT_lx " way %d\n", __func__, new_EPN, EPN, CMP, RPN, way);