[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 05/12] target-i386: Make plus_features/minus_
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v5 05/12] target-i386: Make plus_features/minus_features QOM-based |
Date: |
Fri, 25 Nov 2016 15:51:11 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eduardo Habkost <address@hidden> writes:
> Instead of using custom feature name lookup code for
> plus_features/minus_features, save the property names used in
> "[+-]feature" and use object_property_set_bool() to set them.
>
> We don't need a feat2prop() call because we now have alias
> properties for the old names containing underscores.
>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> Changes v4 -> v5:
> * Removed feat2prop() call, as we now have property aliases for
> the old names containing underscores
>
> Changes series v3 -> v4:
> * New patch added to series
> ---
> target-i386/cpu.c | 106
> +++++++++++-------------------------------------------
> 1 file changed, 20 insertions(+), 86 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 6b5bf59..cef4ecd 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
[...]
> @@ -2047,10 +1967,12 @@ static void x86_cpu_parse_featurestr(const char
> *typename, char *features,
>
> /* Compatibility syntax: */
> if (featurestr[0] == '+') {
> - add_flagname_to_bitmaps(featurestr + 1, plus_features,
> &local_err);
> + plus_features = g_list_append(plus_features,
> + g_strdup(featurestr + 1));
> continue;
> } else if (featurestr[0] == '-') {
> - add_flagname_to_bitmaps(featurestr + 1, minus_features,
> &local_err);
> + minus_features = g_list_append(minus_features,
> + g_strdup(featurestr + 1));
> continue;
> }
>
Since removes the only assignments to local_err other than its
initialization to null, it can't become non-null anymore. Coverity
points out:
*** CID 1365201: Possible Control flow issues (DEADCODE)
/target-i386/cpu.c: 2050 in x86_cpu_parse_featurestr()
2044 prop->value = g_strdup(val);
2045 prop->errp = &error_fatal;
2046 qdev_prop_register_global(prop);
2047 }
2048
2049 if (local_err) {
>>> CID 1365201: Possible Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "error_propagate(errp,
local...".
2050 error_propagate(errp, local_err);
2051 }
2052 }
2053
2054 static void x86_cpu_load_features(X86CPU *cpu, Error **errp);
2055 static int x86_cpu_filter_features(X86CPU *cpu);
[...]
Please clean this up.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v5 05/12] target-i386: Make plus_features/minus_features QOM-based,
Markus Armbruster <=