[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] target-i386: Remove unused local_err variable



commit 685479bd5dc6f54f6230c9d05d7a3fb5cab867bf
Author:     Eduardo Habkost <ehabkost@xxxxxxxxxx>
AuthorDate: Fri Nov 25 13:21:53 2016 -0200
Commit:     Eduardo Habkost <ehabkost@xxxxxxxxxx>
CommitDate: Fri Nov 25 15:12:23 2016 -0200

    target-i386: Remove unused local_err variable
    
    local_err can never be set to non-NULL. Remove the variable.
    
    Detected by Coverity:
    
        *** 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);
    
    Reported-by: Markus Armbruster <armbru@xxxxxxxxxx>
    Message-Id: <1480087313-15102-1-git-send-email-ehabkost@xxxxxxxxxx>
    Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
---
 target-i386/cpu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6eec5dc..de1f30e 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2001,7 +2001,6 @@ static void x86_cpu_parse_featurestr(const char 
*typename, char *features,
                                      Error **errp)
 {
     char *featurestr; /* Single 'key=value" string being parsed */
-    Error *local_err = NULL;
     static bool cpu_globals_initialized;
     bool ambiguous = false;
 
@@ -2015,7 +2014,7 @@ static void x86_cpu_parse_featurestr(const char 
*typename, char *features,
     }
 
     for (featurestr = strtok(features, ",");
-         featurestr  && !local_err;
+         featurestr;
          featurestr = strtok(NULL, ",")) {
         const char *name;
         const char *val = NULL;
@@ -2086,10 +2085,6 @@ static void x86_cpu_parse_featurestr(const char 
*typename, char *features,
         error_report("warning: Compatibility of ambiguous CPU model "
                      "strings won't be kept on future QEMU versions");
     }
-
-    if (local_err) {
-        error_propagate(errp, local_err);
-    }
 }
 
 static void x86_cpu_load_features(X86CPU *cpu, Error **errp);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.