From 007b06578ab6063d49b6834d95274c37387a1efb Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 11 Sep 2015 15:04:45 +0200 Subject: Use error_fatal to simplify obvious fatal errors Done with this Coccinelle semantic patch: @@ type T; identifier FUN, RET; expression list ARGS; expression ERR, EC; @@ ( - T RET = FUN(ARGS, &ERR); + T RET = FUN(ARGS, &error_fatal); | - RET = FUN(ARGS, &ERR); + RET = FUN(ARGS, &error_fatal); | - FUN(ARGS, &ERR); + FUN(ARGS, &error_fatal); ) - if (ERR != NULL) { - error_report_err(ERR); - exit(EC); - } This is actually a more elegant version of my initial semantic patch by courtesy of Eduardo. It leaves dead Error * variables behind, cleaned up manually. Cc: qemu-arm@nongnu.org Cc: "Michael S. Tsirkin" Cc: Eduardo Habkost Cc: Paolo Bonzini Signed-off-by: Markus Armbruster Reviewed-by: Eduardo Habkost --- hw/arm/vexpress.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'hw/arm/vexpress.c') diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 058abbde3f..ea9a9840d0 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -211,7 +211,6 @@ static void init_cpus(const char *cpu_model, const char *privdev, /* Create the actual CPUs */ for (n = 0; n < smp_cpus; n++) { Object *cpuobj = object_new(object_class_get_name(cpu_oc)); - Error *err = NULL; if (!secure) { object_property_set_bool(cpuobj, false, "has_el3", NULL); @@ -221,11 +220,7 @@ static void init_cpus(const char *cpu_model, const char *privdev, object_property_set_int(cpuobj, periphbase, "reset-cbar", &error_abort); } - object_property_set_bool(cpuobj, true, "realized", &err); - if (err) { - error_report_err(err); - exit(1); - } + object_property_set_bool(cpuobj, true, "realized", &error_fatal); } /* Create the private peripheral devices (including the GIC); -- cgit 1.4.1