diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-07-07 18:06:07 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-07-10 15:18:08 +0200 |
commit | b11a093c6025635b4504d79d30daa334a01279a5 (patch) | |
tree | ba15ee5016a149a5fc3d302417398cd585754f13 /hw/acpi | |
parent | 4bc6d7ee0e95b879b7f4823b6e765cf9bf5845e7 (diff) |
qapi: Smooth another visitor error checking pattern
Convert
visit_type_FOO(v, ..., &ptr, &err);
...
if (err) {
...
}
to
visit_type_FOO(v, ..., &ptr, errp);
...
if (!ptr) {
...
}
for functions that set @ptr to non-null / null on success / error.
Eliminate error_propagate() that are now unnecessary. Delete @err
that are now unused.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-40-armbru@redhat.com>
Diffstat (limited to 'hw/acpi')
-rw-r--r-- | hw/acpi/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 8b240c3e09..f6d9ec4f13 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -239,7 +239,6 @@ static void acpi_table_install(const char unsigned *blob, size_t bloblen, void acpi_table_add(const QemuOpts *opts, Error **errp) { AcpiTableOptions *hdrs = NULL; - Error *err = NULL; char **pathnames = NULL; char **cur; size_t bloblen = 0; @@ -249,11 +248,11 @@ void acpi_table_add(const QemuOpts *opts, Error **errp) Visitor *v; v = opts_visitor_new(opts); - visit_type_AcpiTableOptions(v, NULL, &hdrs, &err); + visit_type_AcpiTableOptions(v, NULL, &hdrs, errp); visit_free(v); } - if (err) { + if (!hdrs) { goto out; } if (hdrs->has_file == hdrs->has_data) { |