From patchwork Tue Feb 12 16:13:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 219875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DCB7D2C0040 for ; Wed, 13 Feb 2013 03:13:52 +1100 (EST) Received: from localhost ([::1]:60134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5IUQ-00060p-HY for incoming@patchwork.ozlabs.org; Tue, 12 Feb 2013 11:13:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5IUE-00060K-2o for qemu-devel@nongnu.org; Tue, 12 Feb 2013 11:13:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5IU6-0005iR-IO for qemu-devel@nongnu.org; Tue, 12 Feb 2013 11:13:37 -0500 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:60360 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5IU6-0005iL-AN for qemu-devel@nongnu.org; Tue, 12 Feb 2013 11:13:30 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1U5IU3-0002BT-C9; Tue, 12 Feb 2013 16:13:27 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 12 Feb 2013 16:13:27 +0000 Message-Id: <1360685607-8372-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: "Edgar E. Iglesias" , Michael Walle , Jia Liu , patches@linaro.org Subject: [Qemu-devel] [PATCH] qemu-log: Remove qemu_log_try_set_file() and its users X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Remove the function qemu_log_try_set_file() and its users (which are all in TCG code generation functions for various targets). This function was added to abstract out code which was originally written as "if (!logfile) logfile = stderr;" in order that BUG: case code which did an unguarded "fprintf(logfile, ...)" would not crash if debug logging was not enabled. Since those direct uses of logfile have also been abstracted away into qemu_log() calls which check for a NULL logfile, there is no need for the target-* files to mess with the user's chosen logging settings. Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber Acked-by: Michael Walle --- include/qemu/log.h | 8 -------- target-cris/translate.c | 2 -- target-lm32/translate.c | 2 -- target-microblaze/translate.c | 2 -- target-openrisc/translate.c | 2 -- 5 files changed, 16 deletions(-) diff --git a/include/qemu/log.h b/include/qemu/log.h index 5a46555..4527003 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -126,14 +126,6 @@ static inline void qemu_log_set_file(FILE *f) qemu_logfile = f; } -/* Set up a new log file, only if none is set */ -static inline void qemu_log_try_set_file(FILE *f) -{ - if (!qemu_logfile) { - qemu_logfile = f; - } -} - /* define log items */ typedef struct QEMULogItem { int mask; diff --git a/target-cris/translate.c b/target-cris/translate.c index 09e6011..2964a21 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -3215,8 +3215,6 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb, int num_insns; int max_insns; - qemu_log_try_set_file(stderr); - if (env->pregs[PR_VR] == 32) { dc->decoder = crisv32_decoder; dc->clear_locked_irq = 0; diff --git a/target-lm32/translate.c b/target-lm32/translate.c index 6b87340..ccaf838 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -1012,8 +1012,6 @@ static void gen_intermediate_code_internal(CPULM32State *env, int num_insns; int max_insns; - qemu_log_try_set_file(stderr); - pc_start = tb->pc; dc->env = env; dc->tb = tb; diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 58ce712..0b05264 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -1734,8 +1734,6 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb, int num_insns; int max_insns; - qemu_log_try_set_file(stderr); - pc_start = tb->pc; dc->env = env; dc->tb = tb; diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c index 1e1b30c..23e853e 100644 --- a/target-openrisc/translate.c +++ b/target-openrisc/translate.c @@ -1670,8 +1670,6 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, int num_insns; int max_insns; - qemu_log_try_set_file(stderr); - pc_start = tb->pc; dc->tb = tb;