diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-07-07 18:06:04 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-07-10 15:18:08 +0200 |
commit | 992861fb1e4cf410f30ec8f05bd2dc2a14a5a027 (patch) | |
tree | 9d4d5de47d4ebae50838cd7f8ea39b89a3604507 /target | |
parent | af175e85f92c870386ad74f466e29537b79611d3 (diff) |
error: Eliminate error_propagate() manually
When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away. The previous two commits did that for sufficiently simple
cases with Coccinelle. Do it for several more manually.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-37-armbru@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/i386/cpu.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6f27f12ec7..e46ab8f774 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5260,16 +5260,13 @@ static void x86_cpu_to_dict_full(X86CPU *cpu, QDict *props) static void object_apply_props(Object *obj, QDict *props, Error **errp) { const QDictEntry *prop; - Error *err = NULL; for (prop = qdict_first(props); prop; prop = qdict_next(props, prop)) { if (!object_property_set_qobject(obj, qdict_entry_key(prop), - qdict_entry_value(prop), &err)) { + qdict_entry_value(prop), errp)) { break; } } - - error_propagate(errp, err); } /* Create X86CPU object according to model+props specification */ @@ -6327,19 +6324,18 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp) FeatureWord w; int i; GList *l; - Error *local_err = NULL; for (l = plus_features; l; l = l->next) { const char *prop = l->data; - if (!object_property_set_bool(OBJECT(cpu), prop, true, &local_err)) { - goto out; + if (!object_property_set_bool(OBJECT(cpu), prop, true, errp)) { + return; } } for (l = minus_features; l; l = l->next) { const char *prop = l->data; - if (!object_property_set_bool(OBJECT(cpu), prop, false, &local_err)) { - goto out; + if (!object_property_set_bool(OBJECT(cpu), prop, false, errp)) { + return; } } @@ -6437,11 +6433,6 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp) if (env->cpuid_xlevel2 == UINT32_MAX) { env->cpuid_xlevel2 = env->cpuid_min_xlevel2; } - -out: - if (local_err != NULL) { - error_propagate(errp, local_err); - } } /* |