diff mbox series

[v3,25/25] cpu: get rid of cpu_generic_init()

Message ID 1516694904-64879-26-git-send-email-imammedo@redhat.com
State New
Headers show
Series generalize parsing of cpu_model (part 4) | expand

Commit Message

Igor Mammedov Jan. 23, 2018, 8:08 a.m. UTC
There aren't any users of the helper left, remove it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
CC: Richard Henderson <richard.henderson@linaro.org>
CC: "Emilio G. Cota" <cota@braap.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Eduardo Habkost <ehabkost@redhat.com>
CC: "Alex Bennée" <alex.bennee@linaro.org>
CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
---
 qom/cpu.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

Comments

Igor Mammedov Feb. 5, 2018, 5:09 p.m. UTC | #1
On Tue, 23 Jan 2018 09:08:24 +0100
Igor Mammedov <imammedo@redhat.com> wrote:

> There aren't any users of the helper left, remove it.
after rebase this patch nor longer does what subj says
and it should be squashed into 23/25 where cpu_generic_init() is removed,
so pls ignore this patch I'll post v4 for 23/25 with this squashed in
and actual removal of not used MachineState::cpu_model
which I've lost on rebase.

> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> CC: Richard Henderson <richard.henderson@linaro.org>
> CC: "Emilio G. Cota" <cota@braap.org>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> CC: "Alex Bennée" <alex.bennee@linaro.org>
> CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
> ---
>  qom/cpu.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/qom/cpu.c b/qom/cpu.c
> index aab8437..cf6880d 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -304,22 +304,9 @@ static ObjectClass *cpu_common_class_by_name(const char *cpu_model)
>  static void cpu_common_parse_features(const char *typename, char *features,
>                                        Error **errp)
>  {
> -    char *featurestr; /* Single "key=value" string being parsed */
>      char *val;
> -    static bool cpu_globals_initialized;
> -
> -    /* TODO: all callers of ->parse_features() need to be changed to
> -     * call it only once, so we can remove this check (or change it
> -     * to assert(!cpu_globals_initialized).
> -     * Current callers of ->parse_features() are:
> -     * - cpu_generic_init()
> -     */
> -    if (cpu_globals_initialized) {
> -        return;
> -    }
> -    cpu_globals_initialized = true;
> -
> -    featurestr = features ? strtok(features, ",") : NULL;
> +    /* Single "key=value" string being parsed */
> +    char *featurestr = features ? strtok(features, ",") : NULL;
>  
>      while (featurestr) {
>          val = strchr(featurestr, '=');
diff mbox series

Patch

diff --git a/qom/cpu.c b/qom/cpu.c
index aab8437..cf6880d 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -304,22 +304,9 @@  static ObjectClass *cpu_common_class_by_name(const char *cpu_model)
 static void cpu_common_parse_features(const char *typename, char *features,
                                       Error **errp)
 {
-    char *featurestr; /* Single "key=value" string being parsed */
     char *val;
-    static bool cpu_globals_initialized;
-
-    /* TODO: all callers of ->parse_features() need to be changed to
-     * call it only once, so we can remove this check (or change it
-     * to assert(!cpu_globals_initialized).
-     * Current callers of ->parse_features() are:
-     * - cpu_generic_init()
-     */
-    if (cpu_globals_initialized) {
-        return;
-    }
-    cpu_globals_initialized = true;
-
-    featurestr = features ? strtok(features, ",") : NULL;
+    /* Single "key=value" string being parsed */
+    char *featurestr = features ? strtok(features, ",") : NULL;
 
     while (featurestr) {
         val = strchr(featurestr, '=');