All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, libvir-list@redhat.com,
	dahi@linux.vnet.ibm.com, Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Jiri Denemark <jdenemar@redhat.com>,
	Richard Henderson <rth@twiddle.net>
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	[thread overview]
Message-ID: <871sxzbokg.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1475261386-20211-6-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Fri, 30 Sep 2016 15:49:39 -0300")

Eduardo Habkost <ehabkost@redhat.com> 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 <ehabkost@redhat.com>
> ---
> 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.

  reply	other threads:[~2016-11-25 14:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30 18:49 [Qemu-devel] [PATCH v5 00/12] Add runnability info to query-cpu-definitions Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 01/12] tests: Add test case for x86 feature parsing compatibility Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 02/12] target-i386: List CPU models using subclass list Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 03/12] target-i386: Disable VME by default with TCG Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 04/12] target-i386: Register aliases for feature names with underscores Eduardo Habkost
2016-09-30 19:56   ` [Qemu-devel] [libvirt] " Eric Blake
2016-09-30 20:59     ` Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 05/12] target-i386: Make plus_features/minus_features QOM-based Eduardo Habkost
2016-11-25 14:51   ` Markus Armbruster [this message]
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 06/12] target-i386: Remove underscores from feat_names arrays Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 07/12] target-i386: Register properties for feature aliases manually Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 08/12] target-i386: xsave: Add FP and SSE bits to x86_ext_save_areas Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 09/12] target-i386: Move warning code outside x86_cpu_filter_features() Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 10/12] target-i386: x86_cpu_load_features() function Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 11/12] qmp: Add runnability information to query-cpu-definitions Eduardo Habkost
2016-10-07 20:25   ` Eduardo Habkost
2016-09-30 18:49 ` [Qemu-devel] [PATCH v5 12/12] target-i386: Return runnability information on query-cpu-definitions Eduardo Habkost
2016-10-07 18:54 ` [Qemu-devel] [PATCH v5 00/12] Add runnability info to query-cpu-definitions Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sxzbokg.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.