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: 14763 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 539E523E51 for ; Tue, 12 Feb 2013 16:13:33 +0000 (UTC) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by fiordland.canonical.com (Postfix) with ESMTP id CDB10A1897F for ; Tue, 12 Feb 2013 16:13:32 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id b10so229374vea.2 for ; Tue, 12 Feb 2013 08:13:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=d7VG1AHP+dZvjnixwLsgtsPC5mVydTVhUP4WXGpDMu4=; b=i6gzTKproVGooJ2yXNllwCIZc3epWWCisU48U24QQyQBuRTwEsAH3Tfbx2M94qPQCF WUhhqG5qO0VNTvIMVm2ekBQPttrxz1iyBIJ8OlfilJAEnEg4IRy/6KjXGdl9VIyhXtvI HM2JUmLjrwums3RJDe+NqtygeY1E14aGSau6+c/aAF796UBG5II1uWcpVtG/0cWQSuX5 XCF80T90isrfwf7OJrFC5xv/j9T6wYaZGsR+qVbAVQ84DhoZVg5EuwVkr7Jfgyxlbgp6 WuZW8/iq7kJ58oZa9EkiP1dB5S82nOzxs4ydpMfaRpQb0jnaYoqi6vjp8YGI9j6BhjmX zCpw== X-Received: by 10.52.98.5 with SMTP id ee5mr21208003vdb.102.1360685612159; Tue, 12 Feb 2013 08:13:32 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp144644vcb; Tue, 12 Feb 2013 08:13:31 -0800 (PST) X-Received: by 10.194.76.137 with SMTP id k9mr32248213wjw.29.1360685610660; Tue, 12 Feb 2013 08:13:30 -0800 (PST) Received: from mnementh.archaic.org.uk (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]) by mx.google.com with ESMTPS id wp9si15737018wjb.22.2013.02.12.08.13.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 12 Feb 2013 08:13:30 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk 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 Cc: patches@linaro.org, "Edgar E. Iglesias" , Michael Walle , Jia Liu Subject: [PATCH] qemu-log: Remove qemu_log_try_set_file() and its users 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-Gm-Message-State: ALoCoQkdLd2RR/ZaOz75M3/iDvTF8rBMLbi/i5FNQ2EJlbFvN1lNzY5TeK/sjggwpC0LAgxfalgc 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;