]> git.proxmox.com Git - mirror_qemu.git/commit - vl.c
Use error_fatal to simplify obvious fatal errors
authorMarkus Armbruster <armbru@redhat.com>
Fri, 11 Sep 2015 13:04:45 +0000 (15:04 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 13 Jan 2016 10:58:58 +0000 (11:58 +0100)
commit007b06578ab6063d49b6834d95274c37387a1efb
treed8218a5a0b7c377079468333483a8d6576ab6192
parent8d780f43921feb7fd8d0b58f779a22d1265f2378
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" <mst@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
13 files changed:
hw/arm/exynos4210.c
hw/arm/highbank.c
hw/arm/integratorcp.c
hw/arm/realview.c
hw/arm/versatilepb.c
hw/arm/vexpress.c
hw/arm/xilinx_zynq.c
hw/char/serial.c
hw/core/qdev-properties-system.c
hw/i386/pc.c
hw/smbios/smbios.c
numa.c
vl.c