From patchwork Mon Oct 16 13:12:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10008259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C3D1360230 for ; Mon, 16 Oct 2017 13:15:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAC422857D for ; Mon, 16 Oct 2017 13:15:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EF7F2857F; Mon, 16 Oct 2017 13:15:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 054012857D for ; Mon, 16 Oct 2017 13:15:23 +0000 (UTC) Received: from localhost ([::1]:32936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45Eo-0004XV-A0 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Oct 2017 09:15:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CM-0003F6-L2 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CK-00014Y-F0 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33218) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CK-00013A-6S for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A8F281E06; Mon, 16 Oct 2017 13:12:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4A8F281E06 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77E125C7A4; Mon, 16 Oct 2017 13:12:46 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:40 +0200 Message-Id: <1508159564-30317-2-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 16 Oct 2017 13:12:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/5] hw/m68k: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org, Alistair Francis Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Thomas Huth [thuth: Remove "qemu:" prefix from strings] Signed-off-by: Thomas Huth --- hw/m68k/an5206.c | 4 ++-- hw/m68k/mcf5206.c | 3 ++- hw/m68k/mcf5208.c | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c index 9002c46..db634cb 100644 --- a/hw/m68k/an5206.c +++ b/hw/m68k/an5206.c @@ -66,7 +66,7 @@ static void an5206_init(MachineState *machine) if (qtest_enabled()) { return; } - fprintf(stderr, "Kernel image must be specified\n"); + error_report("Kernel image must be specified"); exit(1); } @@ -83,7 +83,7 @@ static void an5206_init(MachineState *machine) entry = KERNEL_LOAD_ADDR; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); + error_report("Could not load kernel '%s'", kernel_filename); exit(1); } diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index b81901f..fbf3f0f 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -6,6 +6,7 @@ * This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -220,7 +221,7 @@ static void m5206_mbar_update(m5206_mbar_state *s) break; default: /* Unknown vector. */ - fprintf(stderr, "Unhandled vector for IRQ %d\n", irq); + error_report("Unhandled vector for IRQ %d", irq); vector = 0xf; break; } diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index b9dde75..c9c5f5e 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -6,6 +6,7 @@ * This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -257,7 +258,7 @@ static void mcf5208evb_init(MachineState *machine) mcf5208_sys_init(address_space_mem, pic); if (nb_nics > 1) { - fprintf(stderr, "Too many NICs\n"); + error_report("Too many NICs"); exit(1); } if (nd_table[0].used) { @@ -292,7 +293,7 @@ static void mcf5208evb_init(MachineState *machine) if (qtest_enabled()) { return; } - fprintf(stderr, "Kernel image must be specified\n"); + error_report("Kernel image must be specified"); exit(1); } @@ -309,7 +310,7 @@ static void mcf5208evb_init(MachineState *machine) entry = 0x40000000; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); + error_report("Could not load kernel '%s'", kernel_filename); exit(1); }