From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIzIR-0006bg-FG for qemu-devel@nongnu.org; Sun, 08 May 2011 04:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIzIQ-0007Ms-Bt for qemu-devel@nongnu.org; Sun, 08 May 2011 04:24:59 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:62030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIzIP-0007Mo-Ve for qemu-devel@nongnu.org; Sun, 08 May 2011 04:24:58 -0400 From: Stefan Weil Date: Sun, 8 May 2011 10:24:39 +0200 Message-Id: <1304843079-29735-1-git-send-email-weil@mail.berlios.de> Subject: [Qemu-devel] [PATCH] target-mips: Fix warning caused by unused local variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Aurelien Jarno cppcheck report: target-mips/helper.c:276: style: Variable 'access_type' is assigned a value that is never used 'access_type' is only used for system emulation, so the patch simply fixes the conditional compilation. There remains an issue with the return value 'ret' in user mode emulation. The assignment ret = TLBRET_NOMATCH is without effect because there is a ret = 1 later. Which one is correct? Cc: Aurelien Jarno Signed-off-by: Stefan Weil --- target-mips/helper.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target-mips/helper.c b/target-mips/helper.c index bdc1e53..f3cd521 100644 --- a/target-mips/helper.c +++ b/target-mips/helper.c @@ -272,8 +272,8 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, #if !defined(CONFIG_USER_ONLY) target_phys_addr_t physical; int prot; -#endif int access_type; +#endif int ret = 0; #if 0 @@ -284,13 +284,13 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, rw &= 1; +#if defined(CONFIG_USER_ONLY) + ret = TLBRET_NOMATCH; +#else /* data access */ /* XXX: put correct access by using cpu_restore_state() correctly */ access_type = ACCESS_INT; -#if defined(CONFIG_USER_ONLY) - ret = TLBRET_NOMATCH; -#else ret = get_physical_address(env, &physical, &prot, address, rw, access_type); qemu_log("%s address=" TARGET_FMT_lx " ret %d physical " TARGET_FMT_plx " prot %d\n", -- 1.7.2.5