Skip to content

Commit

Permalink
hw/ppc/spapr_drc: Replace error_setg(&error_abort) by error_report() …
Browse files Browse the repository at this point in the history
…+ abort()

Use error_report() + abort() instead of error_setg(&error_abort),
as suggested by the "qapi/error.h" documentation:

    Please don't error_setg(&error_fatal, ...), use error_report() and
    exit(), because that's more obvious.
    Likewise, don't error_setg(&error_abort, ...), use assert().

Use abort() instead of the suggested assert() because the error message
already got displayed.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
philmd authored and dgibson committed Jun 11, 2018
1 parent 45fefe7 commit e20c631
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/ppc/spapr_drc.c
Expand Up @@ -366,7 +366,8 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
break;
}
default:
error_setg(&error_abort, "device FDT in unexpected state: %d", tag);
error_report("device FDT in unexpected state: %d", tag);
abort();
}
fdt_offset = fdt_offset_next;
} while (fdt_depth != 0);
Expand Down

0 comments on commit e20c631

Please sign in to comment.