From patchwork Tue Feb 9 13:25:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8261901 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 434079F38B for ; Tue, 9 Feb 2016 13:26:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B90520268 for ; Tue, 9 Feb 2016 13:26:25 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id AA8CC20263 for ; Tue, 9 Feb 2016 13:26:24 +0000 (UTC) Received: from localhost ([::1]:55993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT8JE-0002BI-1z for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 08:26:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT8Ix-00029U-La for qemu-devel@nongnu.org; Tue, 09 Feb 2016 08:26:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT8Is-0005kh-1L for qemu-devel@nongnu.org; Tue, 09 Feb 2016 08:26:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT8Ir-0005kO-Pz for qemu-devel@nongnu.org; Tue, 09 Feb 2016 08:26:01 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 7CBAFC00126D for ; Tue, 9 Feb 2016 13:26:01 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19DPxqd026873 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 9 Feb 2016 08:26:00 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 01DF63006AE4; Tue, 9 Feb 2016 14:25:58 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 9 Feb 2016 14:25:56 +0100 Message-Id: <1455024358-31133-2-git-send-email-armbru@redhat.com> In-Reply-To: <1455024358-31133-1-git-send-email-armbru@redhat.com> References: <1455024358-31133-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] Use error_fatal to simplify obvious fatal errors (again) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Done with the Coccinelle semantic patch from commit 007b065, plus manual clean up of dead variables. Signed-off-by: Markus Armbruster Message-Id: <1452783732-6581-1-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake --- hw/arm/imx25_pdk.c | 7 +------ hw/arm/kzm.c | 7 +------ hw/arm/netduino2.c | 7 +------ hw/arm/xlnx-ep108.c | 7 +------ vl.c | 7 +------ 5 files changed, 5 insertions(+), 30 deletions(-) diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c index b167e19..e3cffd1 100644 --- a/hw/arm/imx25_pdk.c +++ b/hw/arm/imx25_pdk.c @@ -65,7 +65,6 @@ static struct arm_boot_info imx25_pdk_binfo; static void imx25_pdk_init(MachineState *machine) { IMX25PDK *s = g_new0(IMX25PDK, 1); - Error *err = NULL; unsigned int ram_size; unsigned int alias_offset; int i; @@ -74,11 +73,7 @@ static void imx25_pdk_init(MachineState *machine) object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), &error_abort); - object_property_set_bool(OBJECT(&s->soc), true, "realized", &err); - if (err != NULL) { - error_report_err(err); - exit(1); - } + object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal); /* We need to initialize our memory */ if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE)) { diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c index 55fb360..2eeb9d8 100644 --- a/hw/arm/kzm.c +++ b/hw/arm/kzm.c @@ -64,7 +64,6 @@ static struct arm_boot_info kzm_binfo = { static void kzm_init(MachineState *machine) { IMX31KZM *s = g_new0(IMX31KZM, 1); - Error *err = NULL; unsigned int ram_size; unsigned int alias_offset; unsigned int i; @@ -73,11 +72,7 @@ static void kzm_init(MachineState *machine) object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), &error_abort); - object_property_set_bool(OBJECT(&s->soc), true, "realized", &err); - if (err != NULL) { - error_report_err(err); - exit(1); - } + object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal); /* Check the amount of memory is compatible with the SOC */ if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE)) { diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c index 86065d3..49da6e3 100644 --- a/hw/arm/netduino2.c +++ b/hw/arm/netduino2.c @@ -30,18 +30,13 @@ static void netduino2_init(MachineState *machine) { DeviceState *dev; - Error *err = NULL; dev = qdev_create(NULL, TYPE_STM32F205_SOC); if (machine->kernel_filename) { qdev_prop_set_string(dev, "kernel-filename", machine->kernel_filename); } qdev_prop_set_string(dev, "cpu-model", "cortex-m3"); - object_property_set_bool(OBJECT(dev), true, "realized", &err); - if (err != NULL) { - error_report_err(err); - exit(1); - } + object_property_set_bool(OBJECT(dev), true, "realized", &error_fatal); } static void netduino2_machine_init(MachineClass *mc) diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c index 2cd69b5..0de132a 100644 --- a/hw/arm/xlnx-ep108.c +++ b/hw/arm/xlnx-ep108.c @@ -32,7 +32,6 @@ static void xlnx_ep108_init(MachineState *machine) { XlnxEP108 *s = g_new0(XlnxEP108, 1); int i; - Error *err = NULL; uint64_t ram_size = machine->ram_size; /* Create the memory region to pass to the SoC */ @@ -58,11 +57,7 @@ static void xlnx_ep108_init(MachineState *machine) object_property_set_link(OBJECT(&s->soc), OBJECT(&s->ddr_ram), "ddr-ram", &error_abort); - object_property_set_bool(OBJECT(&s->soc), true, "realized", &err); - if (err) { - error_report_err(err); - exit(1); - } + object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal); for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) { SSIBus *spi_bus; diff --git a/vl.c b/vl.c index c581e39..a5502ed 100644 --- a/vl.c +++ b/vl.c @@ -4555,12 +4555,7 @@ int main(int argc, char **argv, char **envp) net_check_clients(); if (boot_once) { - Error *local_err = NULL; - qemu_boot_set(boot_once, &local_err); - if (local_err) { - error_report_err(local_err); - exit(1); - } + qemu_boot_set(boot_once, &error_fatal); qemu_register_reset(restore_boot_order, g_strdup(boot_order)); }