error: Remove unnecessary local_err variables

This patch simplifies code that uses a local_err variable just to
immediately use it for an error_propagate() call.

Coccinelle patch used to perform the changes added to
scripts/coccinelle/remove_local_err.cocci.

Backports commit 6b62d961373e0327f2af8fb77d6d5d6308864180 from qemu
This commit is contained in:
Eduardo Habkost 2018-02-24 19:12:16 -05:00 committed by Lioncash
parent 5ae787f895
commit 0f6513ef62
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1970,7 +1970,7 @@ static void x86_cpu_get_feature_words(struct uc_struct *uc,
{
uint32_t *array = (uint32_t *)opaque;
FeatureWord w;
Error *err = NULL;
// These all get setup below, so no need to initialise them here.
X86CPUFeatureWordInfo word_infos[FEATURE_WORDS];
X86CPUFeatureWordInfoList list_entries[FEATURE_WORDS];
@ -1991,8 +1991,7 @@ static void x86_cpu_get_feature_words(struct uc_struct *uc,
list = &list_entries[w];
}
visit_type_X86CPUFeatureWordInfoList(v, "feature-words", &list, &err);
error_propagate(errp, err);
visit_type_X86CPUFeatureWordInfoList(v, "feature-words", &list, errp);
}
/* Convert all '_' in a feature string option name to '-', to make feature